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)

Issues connecting to Dynamics CRM server using the Visual Studio Dynamics SDK provided by Microsoft.

(0) ShareShare
ReportReport
Posted on by

Hello all! I'm trying to connect to my Dynamics CRM Online 2015 server using the Quickstart VS project from microsoft in the SDK: https://www.microsoft.com/en-us/download/details.aspx?id=44567 ... Here's the tutorial I'm using: https://msdn.microsoft.com/en-us/library/gg334689.aspx ... And here's my issue: I put my credentials in the app.config file and uncommented the connection string I put it in, but I'm getting the error, "The username is not provided. Specify username in ClientCredentials." However, I need someone to tell me EXACTLY where I need to enter the credentials in ClientCredentials, as I'm 100% new to this and can't find where I put them in to save my life. Here's the code I have in the app.config file: 

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
<!-- Online using Office 365 -->
<add name="Server=CRM Online, organization=contoso, user=someone"
connectionString="Url=triseum.crm.dynamics.com; Username=laadams@triseum.onmicrosoft.com; Password=mypasswordwashere"/>

<!-- Online using Windows Live ID -->
<!-- <add name="Server=CRM Online, organization=contoso, user=someone@hotmail.com"
connectionString="Url=contoso.crm.dynamics.com; Username=someone@hotmail.com; Password=password; DeviceID=11hfn41bbqrg580vyvoea05abc; DevicePassword=fuqNIlx%e$.l*+ax_#8O4abc;"/>-->

<!-- On-premises with provided user credentials -->
<!-- <add name="Server=myserver, organization=AdventureWorksCycle, user=administrator"
connectionString="Url=myserver/AdventureWorksCycle; Domain=mydomain; Username=administrator; Password=password;"/> -->

<!-- On-premises using Windows integrated security -->
<!-- <add name="Server=myserver, organization=AdventureWorksCycle"
connectionString="Url=myserver/AdventureWorksCycle;"/> -->

<!-- On-Premises (IFD) with claims -->
<!--<add name="Server=litware.com, organization=contoso, user=someone@litware.com"
connectionString="Url=https://contoso.litware.com; Username=someone@litware.com; Password=password;"/>-->
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Xrm.Sdk" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Xrm.Sdk.Deployment" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.ServiceBus" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

*This post is locked for comments

I have the same question (0)
  • Robert Wittig Profile Picture
    1,885 on at

    Connecting to CRM Online you would use:

    <!-- Online using Office 365 -->

    <add name="Server=CRM Online, organization=contoso, user=someone"

    connectionString="Url=triseum.crm.dynamics.com; Username=laadams@triseum.onmicrosoft.com; Password=mypasswordwashere"/>

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    Everything looks fine. Do you have Identity Foundation installed - http://blog.xrm.com/index.php/2012/10/quick-tip-enable-windows-identity-foundation-windows-8/

  • Community Member Profile Picture
    on at

    Thanks for your help! So, now I'm able to put in my username and password, but I can't quite get it to work. It's telling me the following:

    Enter a CRM server name and port [crm.dynamics.com]: crm.dynamics.com

    Is this organization provisioned in Microsoft Office 365 (y/n) [y]: [y]

    Enter Microsoft account: laadams@triseum.onmicrosoft.com

    Enter Password: **********

    An unsecured or incorrectly secured fault was received from the other party. See

    the inner FaultException for the fault code and detail.

    Server stack trace:

      at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChann

    el.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState

    , TimeSpan timeout)

      at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChann

    el.Request(Message message, TimeSpan timeout)

      at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message messag

    e, TimeSpan timeout)

      at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean on

    eway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan tim

    eout)

      at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCall

    Message methodCall, ProxyOperationRuntime operation)

      at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]:

      at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req

    Msg, IMessage retMsg)

      at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa

    ta, Int32 type)

      at Microsoft.IdentityModel.Protocols.WSTrust.IWSTrustContract.Issue(Message m

    essage)

      at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecu

    rityToken rst, RequestSecurityTokenResponse& rstr)

      at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.AuthenticateLiveIdInternal

    (ClientCredentials clientCredentials, SecurityTokenResponse deviceToken, String

    keyType)

      at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.Authenticate(ClientCredent

    ials clientCredentials, SecurityTokenResponse deviceTokenResponse, String keyTyp

    e)

      at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.Authenticate(ClientCredent

    ials clientCredentials, SecurityTokenResponse deviceTokenResponse)

      at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.AuthenticateLiveIdInternal

    (AuthenticationCredentials authenticationCredentials)

      at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.Authenticate(Authenticatio

    nCredentials authenticationCredentials)

      at Microsoft.Xrm.Sdk.Client.DiscoveryServiceConfiguration.Authenticate(Authen

    ticationCredentials authenticationCredentials)

      at Microsoft.Crm.Sdk.Samples.ServerConnection.GetProxy[TService,TProxy](Confi

    guration currentConfig) in C:\Users\lauraadams97\SDK\SampleCode\CS\HelperCode\Cr

    mServiceHelpers.cs:line 803

      at Microsoft.Crm.Sdk.Samples.ServerConnection.GetDiscoveryProxy() in C:\Users

    \lauraadams97\SDK\SampleCode\CS\HelperCode\CrmServiceHelpers.cs:line 1023

      at Microsoft.Crm.Sdk.Samples.ServerConnection.GetOrganizationAddress() in C:\

    Users\lauraadams97\SDK\SampleCode\CS\HelperCode\CrmServiceHelpers.cs:line 958

      at Microsoft.Crm.Sdk.Samples.ServerConnection.GetServerConfiguration() in C:\

    Users\lauraadams97\SDK\SampleCode\CS\HelperCode\CrmServiceHelpers.cs:line 302

      at Microsoft.Crm.Sdk.Samples.CRUDOperations.Main(String[] args) in C:\Users\l

    auraadams97\SDK\SampleCode\CS\QuickStart\CRUDOperations.cs:line 49

    Authentication Failure

    Press <Enter> to exit.

  • Robert Wittig Profile Picture
    1,885 on at

    for the server name try putting in triseum.crm.dynamics.com.

    if that doesn't work try putting in triseum.crm.dynamics.com:443

  • Verified answer
    Inogic Profile Picture
    682 on at
    You need to provide CRM credentials in “Credentials.xml” file which is located in your machine at below path:
     
    C:\Users\<YourMachineUserName>\AppData\Roaming\CrmServer\Credentials.xml
     
    If “Credentials.xml” file is already there then delete it.
     
    If the file is not present then create new xml file using below data and with named as “Credentials.xml”. And provide your CRM credentials in the file.
     
    <?xml version="1.0" encoding="utf-8"?>
    <Configurations>
      <Configuration>
        <ServerAddress>crm.dynamics.com</ServerAddress>
        <OrganizationName>YourOrganizationName</OrganizationName>
        <HomeRealmUri>
        </HomeRealmUri>
        <Credentials>
          <UserName>Your CRM User Name</UserName>
        </Credentials>
        <EndpointType>OnlineFederation</EndpointType>
        <UserPrincipalName>
        </UserPrincipalName>
      </Configuration>
    </Configurations>
     
    Now run the your application.
     
    When console window is prompted to “Specify the saved server configuration number (1-{0}) [{0}]”  then enter 1.
     
    Hope this will help.
     
    Thanks,
    Sam
  • Community Member Profile Picture
    on at

    OMG. Thank you so much!! That fixed my problem to the T!

  • Suggested answer
    Community Member Profile Picture
    on at

    you saved me. thank you!!

  • Community Member Profile Picture
    on at

    Did you ever get an answer?

    the file is <username>\AppData\Roaming\CrmServer\Credentials.xml

    I got it working but today changed my windows password  and it all broke again.  very messy.

  • Mike Teske Profile Picture
    on at

    In all the sample Microsoft SDK apps I have had to add


    using System.Net;

     ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

    Back to the original problem, which I had as well, it would be a great addition to the samples to console write that the  C:\Users\user\AppData\Roaming\CrmServer\Credentials.xml did not exist, and/or prompt for the missing information.

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