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)

CRM2011 C# Application: Active Directory Authentication on IFD Enabled Deployment

(0) ShareShare
ReportReport
Posted on by

I am currently trying to develop a C# application that will automatically authenticate with current logged on users credentials.

We have two CRM environments. Development and Production. The development environment does not have IFD enabled, Production does have IFD enabled.

I can connect fine to dev but am having issues connecting to production. When using the internal name http://[computername]:5555/XRMServices/2011/Discovery.svc I receive an error stating that no endpoints can be found.

When I enter this address in the browser it does load. However the url references on the generated webpage reflect the https address. https//:[computername]:444/XRMServices/2011/Discovery.svc.

endpoint.PNG

Following the https urls through to the WSDL definition [/XRMServices/2011/Discovery.svc?wsdl=wsdl1] I can see that the authentication type is returning federation.

Has anyone had a similar experience. Is this a configuration issue with CRM?

Thanks,

Daniel

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Bruno Lucas Profile Picture
    5,421 on at

    Hi Daniel,

    Look like some configuration step has been missed. you should have a domain name rather than machine name on the black highlighted part.

    What do you have under the properties > web address window of the Deployment manager:

    What code approach are you using?

    Check this sample from MSDN. Note the difference on the connection strings when connecting to internal, IFD or 365:

    msdn.microsoft.com/.../jj602970.aspx

  • Community Member Profile Picture
    on at

    Hi Andrew,

    Thanks for your quick response!

    I am using the approach outlined here. msdn.microsoft.com/.../hh675404.aspx. Using the IServiceManagement class.

    I am however obtaining the authentication credentials by doing the following:

    NetworkCredential networkCreds = System.Net.CredentialCache.DefaultNetworkCredentials;

    AuthenticationCredentials authCredentials = new AuthenticationCredentials();

    authCredentials.ClientCredentials.Windows.ClientCredential = networkCreds;

    Just to clarify I am using the server name as outlined in the linked webpage. I shall give that code approach and see if I have different results.

    Thanks,

    Daniel

  • Bruno Lucas Profile Picture
    5,421 on at

    Hi Daniel,

    Your code could be working, but if your endpoint url (under developer resources) is showing as: https//:[computername]:444/XRMServices/2011/Discovery.svc, something could be wrong with your IFD. the code won't be able to connect from outside. It needs to have an external domain on the url. something like: https//:[crm.yourdomain.com]:444/XRMServices/2011/Discovery.svc

    Check on the deployment manager >properties >web address to see what values you have there:

    technet.microsoft.com/.../gg188575.aspx

  • Community Member Profile Picture
    on at

    Hi Bruno,

    The code is definitely showing the external url. I have tried some different connection methods since using CrmConnection and have been receiving the following issue:

    SOAP Security negotiation with ‘https://sts.[mydomain].com.au/adfs/services/trust/13/kerberosmixed’ for target ‘https://sts.[mydomain].com.au/adfs/services/trust/13/kerberosmixed’ failed. See Inner exception for more details.

    -> (Inner Exception) The NetworkCredentials provided were unable to create a Kerberos credential, see inner exception for details

    -> (Inner Exception) InitializeSecurityContent failed. Ensure the service principal name is correct.

    This is when attempting to create the CrmConnection with following connection string: "Url=https://internalcrm.[mydomain].com.au:444"

    I have investigated SPNs and from my understanding these are correct but they were definitely confusing and may possibly be setup incorrectly.

    This has been frustrating me beyond belief and I am getting to a point where I am considering not worrying about getting this working and have the users enter their credentials every time.

    Thanks,

    Daniel

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