IIS - IIS7.5 authentication settings for whoamirequest

Asked By Arun Kumar on 29-Oct-11 06:24 AM
In my silverlight 3 application i have to call the currently logged in user id of the crm 4.0 to display some charts. I'm using  whoamiRequest to fetch the id but it always returns only id of one CRM user by which account the IIS is running. I need help in IIS 7.5 authentication settings for this web service. since i am using this web service to fetch the id and this web service accessing the crm through crmservice.
Sri K replied to Arun Kumar on 29-Oct-11 06:58 AM

This could be for either of a couple reasons. Check your site's anonymous settings and see if it's set to use the app pool identity. If so, then the IUSR account isn't used. Instead it uses the app pool identity, allowing you to only have to maintain a single account.

The other possibility is that your folder already had access. For example, if "Users" already had read access then your site will likely work.

Arun Kumar replied to Sri K on 29-Oct-11 07:42 AM
Actually i have the anonymous authentication user as IUSR only and the identity as network service for that site.
And for second possibility could you brief it. The IUSR has read permission for that folder. Did u meant it?
Devil Scorpio replied to Arun Kumar on 29-Oct-11 02:38 PM
Hi,

To retrieve running user id use following code:

Guid UserId = Guid.Empty;
using
 (new
 CrmImpersonator())
{
      CrmAuthenticationToken token = CrmAuthenticationToken.ExtractCrmAuthenticationToken(Context, <OrgName>);
      UserId = token.CallerId;
}

Hope this helps
Arun Kumar replied to Devil Scorpio on 31-Oct-11 02:05 AM
Hi Devil Scorpio

 I have tried impersonator and it is throwing an error"openThreadToken failed with hr=1008". Do u have any idea? Actually whoamiRequest returns a user id which is the user id of the one user and iis also has the same user account. I think i am missing some authentication settings.