none
Regarding Plugin Registration Using xxxx@xxxx.onmicrosoft.com Credentials

    Question

  • When I am trying to register custom plugin using "xxxx@xxxx.onmicrosoft.com Credentials" i.e. office 365 credentials...I am getting error.

    Please provide me solution as Microsoft has changed the process of registering and sign in of users by providing office 365 ids in new online crm 2011 organizations.

    The Error Shown is given below:

    Unhandled Exception: System.ServiceModel.Security.MessageSecurityException: 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.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout)
       at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.IdentityModel.Protocols.WSTrust.IWSTrustContract.Issue(Message message)
       at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken 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(ClientCredentials clientCredentials, SecurityTokenResponse deviceTokenResponse, String keyType)
       at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.Authenticate(ClientCredentials clientCredentials, SecurityTokenResponse deviceTokenResponse)
       at Microsoft.Xrm.Sdk.Client.DiscoveryServiceConfiguration.Authenticate(ClientCredentials clientCredentials, SecurityTokenResponse deviceSecurityTokenResponse)
       at Microsoft.Xrm.Sdk.Client.ServiceProxy`1.AuthenticateCore()
       at PluginRegistrationTool.ManagedTokenDiscoveryServiceProxy.AuthenticateCore() in C:\Users\Zven\Desktop\sdk\tools\pluginregistration\ToolServiceProxies.cs:line 47
       at Microsoft.Xrm.Sdk.Client.ServiceProxy`1.Authenticate()
       at Microsoft.Xrm.Sdk.Client.ServiceProxy`1.ValidateAuthentication()
       at PluginRegistrationTool.ManagedTokenDiscoveryServiceProxy.ValidateAuthentication() in C:\Users\Zven\Desktop\sdk\tools\pluginregistration\ToolServiceProxies.cs:line 53
       at Microsoft.Xrm.Sdk.Client.ServiceContextInitializer`1.Initialize(ServiceProxy`1 proxy)
       at Microsoft.Xrm.Sdk.Client.DiscoveryServiceProxy.Execute(DiscoveryRequest request)
       at PluginRegistrationTool.CrmConnection.RetrieveOrganizations() in C:\Users\Zven\Desktop\sdk\tools\pluginregistration\crmconnection.cs:line 315
       at PluginRegistrationTool.ConnectionsForm.OpenConnection(CrmConnection con) in C:\Users\Zven\Desktop\sdk\tools\pluginregistration\ConnectionsForm.cs:line 940
    Inner Exception: System.ServiceModel.FaultException: Authentication Failure

    Thanks.


    Saturday, July 21, 2012 8:32 AM

All replies

  • Hi,

    I have experienced the same issue, and it seems to be random. I did not change my Discovery URL, and tried for about 2 hours during the morning to connect, researched the issue, etc and No Luck. Late that afternoon, I gave it another go, and I connected without an issue.  I got this problem in 2 situations: first I was trying to use the plugin registration wizard to connect to my crm online organization, and a similiar situation occurs when using the crmsvcutil.exe to generate your early bind code classes.

    The only suggestion I can offer, is try to use the following for the Discovery URL: https://YOURORGNAME.crm.dynamics.com/XRMServices/2011/Discovery.svc

    Just enter your organization name in place of YOURORGNAME. Please post back to let us know if you have any luck.


    CRM Developer Twitter: @Xrmonline Web: www.yousa.co

    Monday, July 23, 2012 8:40 AM
  • I have also been having the same problem with those same tools.

    Additionally, the Developer Toolkit also won't connect from Visual Studio.

    I have tried both discovery URLs with no success:

    - dev.crm.dynamics.com

    - myorg.crm.dynamics.com

    I will keep trying...


    Thanks, Robert

    Monday, July 23, 2012 8:49 PM
  • Try browsing to Settings --> Customizations --> Developer Resources and use the URL under Discovery Service.  It looks like with the change to the new authentication system they changed the default discovery service URL for CRM online to use disco.crm.dynamics.com rather than the old dev.crm.dynamics.com. For the plugin registration tool exclude the /XRMservices/2011/Discovery.svc  part of the url, the tool appends that the URL you enter either way. 

    This should work for the plugin registration tool, i have not verified that it will work for the developer extensions for Visual Studio. 

    Thursday, July 26, 2012 10:56 PM
  • AMLLP Nathan,  That worked for me.  Thanks!
    Friday, July 27, 2012 3:42 PM
  • Try browsing to Settings --> Customizations --> Developer Resources and use the URL under Discovery Service.  It looks like with the change to the new authentication system they changed the default discovery service URL for CRM online to use disco.crm.dynamics.com rather than the old dev.crm.dynamics.com. For the plugin registration tool exclude the /XRMservices/2011/Discovery.svc  part of the url, the tool appends that the URL you enter either way. 

    This should work for the plugin registration tool, i have not verified that it will work for the developer extensions for Visual Studio. 

          AMLLP Natha, thanks alot, its working perfect for me now :)
    Monday, July 30, 2012 8:59 AM
  • I have tried logging on with the new setup early in the morning and in the afternoon. No luck at all.

    I have no problem logging on to Online with solutions using the old Live login.

    Any good idears?

    Tuesday, August 14, 2012 1:46 PM
  • Any advice I can give you Is to try the QuickStart with Simplified Connection code in the new SDK.

    I encounter the same problems and has taken 7 hours of my time already.

    Just out of the blue things stop working. Hope we'll get proper support on this quickly.

    Tuesday, August 21, 2012 9:27 AM
  • I’ve seen plenty of people guessing how to fix it, but nothing is working.  Here’s the code right from the SDK, but adjusting the DiscoveryUri doesn’t help the Authentication Failures.  

            
            public virtual Configuration GetServerConfiguration()
            {
                config.DiscoveryUri = new Uri("https://myorg.crm.dynamics.com/XRMServices/2011/Discovery.svc");  //works prior to 365 authentication
                //config.DiscoveryUri = new Uri("https://disco.crm5.dynamics.com/XRMServices/2011/Discovery.svc");  //does not work
                //config.DiscoveryUri = new Uri("https://disco.crm.dynamics.com/XRMServices/2011/Discovery.svc"); //does not work
                config.DeviceCredentials = GetDeviceCredentials();
                config.OrganizationUri = new Uri("https:// myorg.api.crm.dynamics.com/XRMServices/2011/Organization.svc");  
                config.Credentials = new ClientCredentials();
                config.Credentials.UserName.UserName = "myName@myorg.onmicrosoft.com";
                config.Credentials.UserName.Password = "myPassword";
     
                if (configurations == null) configurations = new List<Configuration>(); 
                configurations.Add(config);
                return config;
            }
    

    Here’s the Error:  
    Exception.Message: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.
    Exception.InnerException.Message: Authentication Failure

    Anyone else banging their head against their keyboard?
    Thursday, August 23, 2012 7:25 PM
  • hi,

    mee to faced the same issue but At Last i fixed it

    1. please delete the LiveDeviceID ....which is there in Users folder of our System(where you are getting service)

    2.discovery URL and organizations Service url are different for it...so u need to keen here

    3.Use organizations or Discover URLS  from developer resources from CRM to get organization or Discovery service

    Please don't forget to Vote and marked as answer If this post answers your question or was helpful, please click "Mark As Answer" on the post and "Mark as Helpful" Be wise

    Thursday, August 23, 2012 11:54 PM
  • Hi Nathan,

      That Works for me... Replacing the "Disco" in the URL ....

    Thanks

    T.Vinoth

    Wednesday, September 12, 2012 9:32 AM
  • i am geting the following error ,whenever i exclude the /XRMservices/2011/Discovery.svc  part of the url in registartion tool.

    i am trying with this dicovery service is -- https://disco.crm5.dynamics.com/XRMServices/2011/Discovery.svc 

    i ecluded the /XRMservices/2011/Discovery.svc  part of the url in registartion tool still following error persist. Is there any other workaround on this.

    Unhandled Exception: System.Security.Cryptography.CryptographicException: The length of the data should be a multiple of 16 bytes.
       at System.Security.Cryptography.ProtectedMemory.Unprotect(Byte[] encryptedData, MemoryProtectionScope scope)
       at Microsoft.Crm.Services.Utility.DeviceUserName.get_DecryptedPassword() in C:\Users\p.suresh.miraje\Desktop\crm tools\sdk\SampleCode\CS\HelperCode\DeviceIdManager.cs:line 714
       at Microsoft.Crm.Services.Utility.DeviceUserName.ToClientCredentials() in C:\Users\p.suresh.miraje\Desktop\crm tools\sdk\SampleCode\CS\HelperCode\DeviceIdManager.cs:line 767
       at Microsoft.Crm.Services.Utility.DeviceIdManager.LoadDeviceCredentials(Uri issuerUri) in C:\Users\p.suresh.miraje\Desktop\crm tools\sdk\SampleCode\CS\HelperCode\DeviceIdManager.cs:line 173
       at Microsoft.Crm.Services.Utility.DeviceIdManager.LoadOrRegisterDevice(Uri issuerUri) in C:\Users\p.suresh.miraje\Desktop\crm tools\sdk\SampleCode\CS\HelperCode\DeviceIdManager.cs:line 61
       at PluginRegistrationTool.CrmConnection.get_DiscoveryService() in C:\Users\p.suresh.miraje\Desktop\crm tools\sdk\tools\pluginregistration\CrmConnection.cs:line 272
       at PluginRegistrationTool.CrmConnection.RetrieveOrganizations() in C:\Users\p.suresh.miraje\Desktop\crm tools\sdk\tools\pluginregistration\CrmConnection.cs:line 367
       at PluginRegistrationTool.ConnectionsForm.OpenConnection(CrmConnection con) in C:\Users\p.suresh.miraje\Desktop\crm tools\sdk\tools\pluginregistration\ConnectionsForm.cs:line 940

    Tuesday, September 25, 2012 10:06 AM
  • Thanks, this solved it for me.
    Friday, September 28, 2012 7:23 PM
  • I faced to the same issue:

    Itried the discovery service https://disco.crm4.dynamics.com and the organization service <a href="https://.api.crm4.dynamics.com">https://<organization>.api.crm4.dynamics.com. In both cases first I deteted the LiveDeviceID folder in my users directory. But every time I get the same error like Piyush.Gupta:

    Unhandled Exception: System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.
    ...
    ...

    I'm using PluginRegistration Tool Version 2.1.0.1

    Has anybody an idea?

    Friday, October 05, 2012 1:41 PM
  • hi,

    it is prob to late, but for others...

    for me it help if I entered the full user name

    xxx(at)xxx.onmicrosoft.com

    (im new here and i cant put @...)

    by the way this solution (with the disco issue) help me with configuration of Dynamics CRM for Outlook

    koby

    • Edited by kobyt Wednesday, February 13, 2013 10:29 AM put something wrong
    Wednesday, February 13, 2013 10:28 AM
  • This worked for me, I was using the older NT format for user and domain, which didn't work. Using the @ format works.

    So do not enter the credentials as domainxxx\userxxxx, but instead enter credentials as userxxx@domainxxx

    Monday, April 08, 2013 7:20 PM