473,804 Members | 3,399 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problerms with iFrames and user identity

WT
Hi,

Working on MS CRM 3, I have created an aspx page using vs2005 and .NET 2.
I am faced with a problem concerning the identity of the running user.
More details:

The CRM application which creates the iFrame is on the same server as the
called aspx page.
CRM is running .NET 1.1, my page .NET 2
They run under IIS6 in différent web sites, different application pools.
The 2 sites are using windows authentication.
the aspx web site listen on port 55505, and the CRM is on default port 80 .

My problem is : the user authenticated in CRM is the connected user, but in
my aspx page instanciated in the iFrame, it is NETWORK SERVICES user, same
as the account used to run the app pool.
and that account has no rights in CRM.

I ask this on this forum because it seems to be a .NET 2 problem, is there
any way to have the same account running CRM and the application called in
the eframe ?

Thanks for help
CS
Mar 8 '06 #1
7 5418
in the web.config, set <identity impersonate="tr ue">, and turn off anonymous
on your website.

-- bruce (sqlwork.com)

"WT" <WT@newsgroups. nospam> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Hi,

Working on MS CRM 3, I have created an aspx page using vs2005 and .NET 2.
I am faced with a problem concerning the identity of the running user.
More details:

The CRM application which creates the iFrame is on the same server as the
called aspx page.
CRM is running .NET 1.1, my page .NET 2
They run under IIS6 in différent web sites, different application pools.
The 2 sites are using windows authentication.
the aspx web site listen on port 55505, and the CRM is on default port 80
.

My problem is : the user authenticated in CRM is the connected user, but
in my aspx page instanciated in the iFrame, it is NETWORK SERVICES user,
same as the account used to run the app pool.
and that account has no rights in CRM.

I ask this on this forum because it seems to be a .NET 2 problem, is there
any way to have the same account running CRM and the application called in
the eframe ?

Thanks for help
CS

Mar 8 '06 #2
WT
Thanks Bruce, but I don't want to impersonate, I simply want to use windows
authentication, i.e. to have the connected user as identity.

CS
"Bruce Barker" <br************ ******@safeco.c om> a écrit dans le message de
news: OZ************* *@TK2MSFTNGP12. phx.gbl...
in the web.config, set <identity impersonate="tr ue">, and turn off
anonymous on your website.

-- bruce (sqlwork.com)

"WT" <WT@newsgroups. nospam> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Hi,

Working on MS CRM 3, I have created an aspx page using vs2005 and .NET 2.
I am faced with a problem concerning the identity of the running user.
More details:

The CRM application which creates the iFrame is on the same server as the
called aspx page.
CRM is running .NET 1.1, my page .NET 2
They run under IIS6 in différent web sites, different application pools.
The 2 sites are using windows authentication.
the aspx web site listen on port 55505, and the CRM is on default port 80
.

My problem is : the user authenticated in CRM is the connected user, but
in my aspx page instanciated in the iFrame, it is NETWORK SERVICES user,
same as the account used to run the app pool.
and that account has no rights in CRM.

I ask this on this forum because it seems to be a .NET 2 problem, is
there any way to have the same account running CRM and the application
called in the eframe ?

Thanks for help
CS


Mar 8 '06 #3
Hi WT,

We can get the client authenticated user's windows identity without
impersonate. Make sure your ASP.NET application's virtual directory is
configured as integrated windows authentication and disable anonymous
access. Also, the ASP.NET applicaiton is using "Windows" authentication,
then in the application's code, we can use HttpContext.Cur rent.User to
access the client authenticated user's principal. Since the iframe page
should be requested by the same client as the container page, your
application should have the same client user identity with the CRM web
application. BTW, without impersonate, we can not access any protected
resource through the identity on the webserver.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)






Mar 9 '06 #4
WT
Hi Steven,

Thanks for help.

I have checked again all your elements and and my code, they are conform.
ASP.NET application uses Windows authentication from web.config
Web Site is configured as integrated windows authentication and anonymous
access is disabled
As I am logged with my account (not administrator), the application code
HttpContext user's Principal is SYSTEM and is authenticated with no
impersonation level.
When I use the CRM call to identify user (WhoAmI) I get SYSTEM NETWORK
account which is the account running the app pool using by default .ASP.NET
2.

Same code not called from CRM iFrame gives normal results with my account
and not SYSTEM NETWORK.

???
To day I will build a small app with an iframe to simulate CRM.

CS

"Steven Cheng[MSFT]" <st*****@online .microsoft.com> a écrit dans le message
de news: $u************* *@TK2MSFTNGXA03 .phx.gbl...
Hi WT,

We can get the client authenticated user's windows identity without
impersonate. Make sure your ASP.NET application's virtual directory is
configured as integrated windows authentication and disable anonymous
access. Also, the ASP.NET applicaiton is using "Windows" authentication,
then in the application's code, we can use HttpContext.Cur rent.User to
access the client authenticated user's principal. Since the iframe page
should be requested by the same client as the container page, your
application should have the same client user identity with the CRM web
application. BTW, without impersonate, we can not access any protected
resource through the identity on the webserver.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)





Mar 9 '06 #5
Thanks for the quick response CS,

Seems strange. Anyway, you can get the username from the raw IIS Server
Variables, if this also shows "NetworkService ", then the request does be
requested from the NetworkService account context. And if so, there should
exists some customization in the CRM server page's code.

#IIS Server Variables
http://msdn.microsoft.com/library/en...4ed-4059-8e21-
6cba2c253006.as p?frame=true

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Mar 9 '06 #6
WT
Hello Steven,

Many thanks, your answer make me find the solution, here is an extract of my
post on MS CRM dev forum

After hours of testing I dicovered that the information in sdk for v3 is not
complete.

It is said that, to gain access to the Guid of the user, we should call
WhoAmI with the
System.Net.Cred entialCache.Def aultCredentials

this is Ok when your application is running directly under IE6, but when the
same application is called from an iFrame defined in a custom entity form,
this object doesn't contain the credentials for the running user but
credentials for the user running the application pool of the web site, often
NETWORK SERVICES.

So, if you write code for iframes, don't try to call whoAmI, if you do so
you don't get your real user id and will have troubles with next webservices
calls.

MS should provide a call to get correct credentials when under CRM iFrame,
as is is the prefered method to customize, these credential could be derived
from request identity that seems to be correct.

May be a bug from DefaultCredenti als, or another call must be used.
CS


"Steven Cheng[MSFT]" <st*****@online .microsoft.com> a écrit dans le message
de news: $u************* *@TK2MSFTNGXA03 .phx.gbl...
Hi WT,

We can get the client authenticated user's windows identity without
impersonate. Make sure your ASP.NET application's virtual directory is
configured as integrated windows authentication and disable anonymous
access. Also, the ASP.NET applicaiton is using "Windows" authentication,
then in the application's code, we can use HttpContext.Cur rent.User to
access the client authenticated user's principal. Since the iframe page
should be requested by the same client as the container page, your
application should have the same client user identity with the CRM web
application. BTW, without impersonate, we can not access any protected
resource through the identity on the webserver.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)





Mar 10 '06 #7
Thanks for your followup.

Glad that you've found the solution. When you meet any further problem need
our help, please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Mar 13 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2234
by: Frances | last post by:
I need to replace iframes acc. to what option user chooses in a sel obj.. but figured have to load a blank iframe when pg loads so I can replace it.. (iframe gets put in a pre-existing div..) this is approach.. I'm having some problems and would appreciate some help.. thank you very much... var selItem; var ifrCurr; var div = document.getElementById("divPricing"); // this var not being read inside functions..
2
3053
by: Jesper Stocholm | last post by:
I have implemented role-based security within my ASP.Net application. However, it seems the role is not passed to the authentication ticket I create. I want to use it to display/hide some content based on the user's role. I wrote this to do it: if (HttpContext.Current.User.Identity.IsAuthenticated) { plLoggedIn.Visible = true;
8
9480
by: Razak | last post by:
Hi, I have a class which basically do Impersonation in my web application. From MS KB sample:- ++++++++++++++++++++code starts Dim impersonationContext As System.Security.Principal.WindowsImpersonationContext Dim currentWindowsIdentity As System.Security.Principal.WindowsIdentity
3
1778
by: Patrick Olurotimi Ige | last post by:
How can i send LOGON_USER or User.Identity.Name to the Database? I'm working on a survey which is intranet based with Windows Authentication. I can get the current user by calling LOGON_USER or User.Identity.Name ! But i want to pass(the current user) to a table in DB! I was thinking of ussing hidden textboxes like so :- Is it a good approach.. Any ideas appreciated!
2
1287
by: Joris De Groote | last post by:
Hi, I am looking for a javascript that can open a link in an iframe. However, the link on wich the user clicks, is from another iframe. So I have 2 Iframes and want to get a html page open in I2 when the user clicks on a link in I1. Is this possible with javascript? Thanks
19
5946
by: wmanzo | last post by:
I have a really professional conspiracy movie site and I use tons of layers and an external scroll bar assembly. I would like to put the various sections into MS Iframes and in order to clean up the page but I find that the iframes interfere with the getting the mouse coords from the screen which is essential in moving the scroll bar around. My test html is given below. With the iframe hidden the mouse coords are obtainable. With the...
3
8960
by: =?Utf-8?B?Q2hhcmxlc0E=?= | last post by:
hi folks, I've got XP pro service pack 2 VS 2005 TSE with ASP.net 2.0 and C# I'm doing an example from Stephen Walther's so far excellent book and he has a whole load of stuff to add the current user to a role like so: <script runat="server"> void Page_Load()
0
1584
Screaming Eagle
by: Screaming Eagle | last post by:
I haven't recieved any information that I could use, and researching this issue hasn't turned up any worthy results. Hence my reposting. Since I have had no reply, and my associates wish to move things along, I have been forced to use regular frames for the site (which works fine, but visually its not what I'd like to produce). Ideally, I would like to fix this problem I currently have with iframes, and do without using regular frames. If anyone...
2
12951
by: ericisjusteric | last post by:
I have a page with multiple iframes and need to have the user (ie6) be able to click a button to refresh any one of the iframes - but also to click another button at the top of the page to refresh all of them - from the server (this could be on page refresh also) as the purpose is to reset the iframe to the original content in case the user clicked on a link in that iframe and changed it, but also in case there were updates to the original page...
0
9705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9576
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10567
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10310
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9138
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4291
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2983
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.