web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

WCF service impersonation or delegation question

(0) ShareShare
ReportReport
Posted on by

HI,

With the help of people on this forum I have managed to create a WCF service, when I run it through visual studio a Internet explorer page opens altering the URL to include my query it returns data as expected.

I've then created a webresource in dynamics crm and if I run the webresource locally and enter my query in CRM it returns data to CRM as expected - so all good so far.

We are now looking to host the service, it appears to host correctly as I can call URL and I can see it exists, however, if I enter some query information it crashes, looking at the log file created it is due to the fact the hosted server isn't a recognised user for our SQL server to authenticate, so how do I get my service to use the credentials of the user calling the service?

I've tried adding impersonation to the code but usually end up with a The contract operation requires windows indentity for automatic impersonation...

To be fair I am lost if honest.

Matt

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Prashant_ Profile Picture
    1,040 on at

    You are tring to open url from web resource so responses are asyncrounous that might be problem

    use following link

    community.dynamics.com/.../113636

  • David Jennaway Profile Picture
    14,065 on at

    If you enable Windows Authentication (via web.config) for your WCF service, then you will be able to impersonate the user who calls the service. You will also need to specify in code that you're using windows credentials when connecting to a resource; if you're connecting to a SQL Server, then you do this by specifying Integrated Security = true in the connection string.

    However, this gets more complicated if the resource is running on a separate server from the WCF service. If this is the case (which is quite likely), you need to have delegation enabled. This doesn't affect the code, but requires that you enable delegation within Active Directory for the relevant services / servers and accounts

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans