locked
PluginRegistrationTool Fails with Error During Discovery RRS feed

  • Question

  • We get a error message during the intial connection to CRM Online 2011 to get a LiveID Devide ID and password for a Azure solution. When running the PluginRegistrationTool build from the CRM 2011 SDK folder, I get the following error:

    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\admin\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\admin\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\admin\Desktop\sdk\tools\pluginregistration\crmconnection.cs:line 315
       at PluginRegistrationTool.ConnectionsForm.OpenConnection(CrmConnection con) in C:\Users\admin\Desktop\sdk\tools\pluginregistration\connectionsform.cs:line 940
    Inner Exception: System.ServiceModel.FaultException: Authentication Failure

     

    I have verified the time is correct, I've tried deleting the LiveDevice.xml from %userprofile%\LiveDeviceID\ and reboot, and I've tried ensuring the platform build target in VS is set to x86 (even though I am running Visual Studio 2010/Plugin Registration Tool on a 64bit Windows 2008 R2 SP1 box)...all from other posts.

    I use the Discovery URL: https://dev.crm.dynamics.com/

    I'm stuck, where do I go from here?



    Friday, April 29, 2011 9:46 PM

Answers

  • There were two issues with two different accounts:

    1. Account 1 - Unknown issues using my primary admin account.  Created account 2 for testing and workaround.  MS Still investigating.
    2. Account 2 - Passwords greater than 15 character's don't appear to be supported and failed during testing.  Works fine on the web, breaks with the registration tool.  Solution was to shorten the password which happened randomly during troubleshooting with Microsoft.

    Hope this helps!

    • Marked as answer by Jim Glass Jr Tuesday, May 17, 2011 4:15 PM
    Monday, May 16, 2011 11:43 PM
  • I did notice the time would switch back almost as soon as I changed it.  I discovered I needed to disable time sync for this Hyper-V virtual machine...since it syncs to the hosts time every few seconds.

    John

    Monday, May 2, 2011 10:20 PM

All replies

  • On my Windows 7 machine my timezone and time are correct but I have to turn my clock exactly one hour back to get my connection to work for CRM Online with the plugin registration tool.   So try turning your clock exactly one hour back and testing it that way to see if it helps, if not, try one hour forward.  It seemed that after I changed the clock settings I had to restart the tool before it worked also.  Maybe you have a bizare one hour off thing going on too. 

    I think it might be related to the settings for autoadjust for daylight savings time.

     


    Jamie Miley
    http://mileyja.blogspot.com
    Linked-In Profile
    Follow Me on Twitter!
    Friday, April 29, 2011 10:20 PM
    Moderator
  • Thanks for the tip Jamie!  It didn't work but the security message of this test makes me rule out the time.

    Normal Domain Synced Time: 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.

    -1 hour: Unhandled Exception: System.ServiceModel.Security.MessageSecurityException: The security timestamp is invalid because its creation time ('2011-04-30T03:08:19.000Z') is in the future. Current time is '2011-04-30T02:08:26.062Z' and allowed clock skew is '00:05:00'.

    + 1 hour: Unhandled Exception: System.ServiceModel.Security.MessageSecurityException: The security timestamp is stale because its expiration time ('2011-04-30T03:17:04.000Z') is in the past. Current time is '2011-04-30T04:12:08.218Z' and allowed clock skew is '00:05:00'.

    DST Disabled: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.

     

    Saturday, April 30, 2011 3:13 AM
  • out of curiosity, was the plugin registration tool built on this same machine?  If not, do you have WIndows Identity Framework installed on this box?
    Jamie Miley
    http://mileyja.blogspot.com
    Linked-In Profile
    Follow Me on Twitter!
    Saturday, April 30, 2011 3:21 AM
    Moderator
  • This is a Windows 2008 R2 64 bit machine with the tool built on the same machine (using VS 2010 SP1) I'm trying to run it from.  WIF is/was installed from: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=eb9c345f-e830-40b8-a5fe-ae7a864c4d76&displaylang=en

    Biztalk 2010 is also installed (with remote SQL server), so maybe I'm getting some issues those components.

    Thanks for all your help Jamie!

    John

    Saturday, April 30, 2011 3:38 AM
  • I was concerned that maybe WIF wasn't installed which could be possible if the tool was built on another machine as it's required to perform the build.

    I don't honestly know if there is potential for problems with Biztalk.  To eliminate a network topology issue and make sure your settings are correct have you potentially tried it from another machine if you build the tool on a different machine.  That would lead me to absolutely believe you are getting a conflict with something.

    a few points of confirmation:  you are using your Live ID credentials correct, not your AD credentials?

    Also do you have the outlook client also installed on this machine.  If so, it could have interfered with your Windows Live essentials.  If you repair your windows live essentials it could help.

    Other than those ideas, I am running out of answers.  


    Jamie Miley
    http://mileyja.blogspot.com
    Linked-In Profile
    Follow Me on Twitter!
    Saturday, April 30, 2011 2:46 PM
    Moderator
  • i remember stumbling across this issue when playing around with the beta of 2011, the fix was something to do with the settings of how the windows machine automatically updates the time using the new server.

     

    unfortunately i dont have my notes to hand, check to see if its automatically being updated by the microsoft new server and disable it, or vice versa....!

     

    let us know how you get on.

     

    Thanks

     

    Jonathan


    Jonathan Nachman MBSP, MCTS

    Microsoft CRM Technical Blog

    Technical CRM Consultant for KMS Software
    Sunday, May 1, 2011 12:55 PM
  • I do have Excel installed (it is required for Biztalk), I don't have the other programs installed (such as Outlook installed).

    Also, I did notice you mentioned Live Essentials, does that need to be installed in addition to WIF? I did not see that in the documentation but that is not installed on this server.

    Live ID credentials are being used, I even created a new CRM Online admin account to test with.

    Thanks for your help and suggestions!

    John G.

    Monday, May 2, 2011 10:18 PM
  • I did notice the time would switch back almost as soon as I changed it.  I discovered I needed to disable time sync for this Hyper-V virtual machine...since it syncs to the hosts time every few seconds.

    John

    Monday, May 2, 2011 10:20 PM
  • Tuesday, May 3, 2011 1:02 PM
    Moderator
  • Hello EveryBody,

    i'm working on a scenario to connect CRM online to a local application through the service bus of windows azure.

    When i lanched the plugin registration tool and try to make connection with CRM Online i have the same message error above.

    did find a solution for this?

    Thank you for help

    Tuesday, May 10, 2011 1:25 PM
  • I think the answer was here already and just not marked yet I would go through the suggestions listed above and/or open a new question.
    Jamie Miley
    http://mileyja.blogspot.com
    Linked-In Profile
    Follow Me on Twitter!
    Tuesday, May 10, 2011 1:37 PM
    Moderator
  • While I would try Jamie's suggestion of checking the above items (time, password, etc)...we currently have a case open with Microsoft on the issue.

    May I ask, what OS and and is it 32/64 bit?

    John

    Tuesday, May 10, 2011 2:57 PM
  • I really think YoungAzure needs to try it to as his situation may be different.  There are definitely documented cases where the time thing is the issue.  And for me personally, I had the auto-adjust for daylight savings causing problems too.
    Jamie Miley
    http://mileyja.blogspot.com
    Linked-In Profile
    Follow Me on Twitter!
    Tuesday, May 10, 2011 3:02 PM
    Moderator
  • Thank you for your Reply.

    I have a Windows 7 64 bits.

    but i didn't understand your suggestion of checking time and password. How can i do that ?


    Thank you again !

    Wednesday, May 11, 2011 8:09 AM
  • Where can i check the time thing?
    Wednesday, May 11, 2011 8:10 AM
  • Just verify that your time is correct (not more than 5 mins off, url below).  Also, double check your entering the right password.

    http://www.time.gov/widget/

    I get a different error when my time is wrong (Unhandled Exception: System.ServiceModel.Security.MessageSecurityException: The security timestamp is invalid because its creation time).  So I don't think that is it if it is the same as (Unhandled Exception: System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrectly secured fault was received from the other party).

    John

     

    Wednesday, May 11, 2011 8:19 AM
  • I modified the time on my PC. I got a different error message , about TimeOut.

    have you ever got this?

     

     

    Unhandled Exception: System.Net.WebException: Unable to connect to remote server
       à System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
       à System.Net.HttpWebRequest.GetRequestStream()
       à Microsoft.Crm.Services.Utility.DeviceIdManager.ExecuteRegistrationRequest(String url, DeviceRegistrationRequest registrationRequest) dans C:\Users\qasbaouia\Desktop\CRM SDK\sdk\SampleCode\CS\HelperCode\DeviceIdManager.cs:ligne 352
       à Microsoft.Crm.Services.Utility.DeviceIdManager.RegisterDevice(Guid applicationId, Uri issuerUri, DeviceUserName userName) dans C:\Users\qasbaouia\Desktop\CRM SDK\sdk\SampleCode\CS\HelperCode\DeviceIdManager.cs:ligne 292
       à Microsoft.Crm.Services.Utility.DeviceIdManager.RegisterDevice(Guid applicationId, Uri issuerUri, String deviceName, String devicePassword) dans C:\Users\qasbaouia\Desktop\CRM SDK\sdk\SampleCode\CS\HelperCode\DeviceIdManager.cs:ligne 188
       à Microsoft.Crm.Services.Utility.DeviceIdManager.LoadOrRegisterDevice(Uri issuerUri, String deviceName, String devicePassword) dans C:\Users\qasbaouia\Desktop\CRM SDK\sdk\SampleCode\CS\HelperCode\DeviceIdManager.cs:ligne 105
       à Microsoft.Crm.Services.Utility.DeviceIdManager.LoadOrRegisterDevice(Uri issuerUri) dans C:\Users\qasbaouia\Desktop\CRM SDK\sdk\SampleCode\CS\HelperCode\DeviceIdManager.cs:ligne 88
       à PluginRegistrationTool.AutoRefreshSecurityToken`2.AuthenticateDevice() dans C:\Users\qasbaouia\Desktop\CRM SDK\sdk\tools\pluginregistration\AutoRefreshSecurityToken.cs:ligne 84
       à PluginRegistrationTool.ManagedTokenDiscoveryServiceProxy.AuthenticateDeviceCore() dans C:\Users\qasbaouia\Desktop\CRM SDK\sdk\tools\pluginregistration\ToolServiceProxies.cs:ligne 41
       à Microsoft.Xrm.Sdk.Client.ServiceProxy`1.AuthenticateCore()
       à PluginRegistrationTool.ManagedTokenDiscoveryServiceProxy.AuthenticateCore() dans C:\Users\qasbaouia\Desktop\CRM SDK\sdk\tools\pluginregistration\ToolServiceProxies.cs:ligne 47
       à Microsoft.Xrm.Sdk.Client.ServiceProxy`1.ValidateAuthentication()
       à PluginRegistrationTool.ManagedTokenDiscoveryServiceProxy.ValidateAuthentication() dans C:\Users\qasbaouia\Desktop\CRM SDK\sdk\tools\pluginregistration\ToolServiceProxies.cs:ligne 53
       à Microsoft.Xrm.Sdk.Client.ServiceContextInitializer`1.Initialize(ServiceProxy`1 proxy)
       à Microsoft.Xrm.Sdk.Client.DiscoveryServiceProxy.Execute(DiscoveryRequest request)
       à PluginRegistrationTool.CrmConnection.RetrieveOrganizations() dans C:\Users\qasbaouia\Desktop\CRM SDK\sdk\tools\pluginregistration\CrmConnection.cs:ligne 315
       à PluginRegistrationTool.ConnectionsForm.OpenConnection(CrmConnection con) dans C:\Users\qasbaouia\Desktop\CRM SDK\sdk\tools\pluginregistration\ConnectionsForm.cs:ligne 940
    Inner Exception: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a certain time, or established connection failed because connected host has not responded 10.83.124.3:3128
       à System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
       à System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)

     

    Wednesday, May 11, 2011 8:59 AM
  • Your server and client must be within 5 minutes of each other when their date, time, and timezone are converted to Zulu time or GMT.
    Jamie Miley
    http://mileyja.blogspot.com
    Linked-In Profile
    Follow Me on Twitter!
    Wednesday, May 11, 2011 10:08 AM
    Moderator
  • i know ! i have the message error about athentification again !!!!

    someone told me about Internet Facing Deployment, to make this working.

    did you hear about that?

    Wednesday, May 11, 2011 12:22 PM
  • No I haven't heard about it.  It's not a pre-requisite to connecting with the tool.

    I did notice your ip it is failing on for the port after you changed your time was one I am not used to.

    Inner Exception: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a certain time, or established connection failed because connected host has not responded 10.83.124.3:3128

    I am wondering if it could be a firewall issue.


    Jamie Miley
    http://mileyja.blogspot.com
    Linked-In Profile
    Follow Me on Twitter!
    Wednesday, May 11, 2011 12:57 PM
    Moderator
  • I see that ! but now i have the other error message about authentification.

    and i don't know why it doesn't work. i spent three days on this without any success.

    did you connect with CRM Online? if yes, how did you do to solve this issue?

    thank you again.

    Wednesday, May 11, 2011 1:05 PM
  • Yes, if in north america you need to use https://dev.crm.dynamics.com

    and you use your liveid and password. It's pretty easy, but I have one windows 7 machine I have to turn the clock back one hour on to connect.  I think it is related to the auto-adjust for daylight savings time.

     

     


    Jamie Miley
    http://mileyja.blogspot.com
    Linked-In Profile
    Follow Me on Twitter!
    Wednesday, May 11, 2011 1:13 PM
    Moderator
  • I'm not in north America. I live in France.

    I don't think that is a problem of time. i'm realy lost....

    Wednesday, May 11, 2011 1:17 PM
  • This is what it shows for what url to use.

    https://dev.crm.dynamics.com  (North America)

    https://dev.crm4.dynamics.com   (EMEA)

    https://dev.crm5.dynamics.com  (APAC)


    Jamie Miley
    http://mileyja.blogspot.com
    Linked-In Profile
    Follow Me on Twitter!
    Wednesday, May 11, 2011 1:22 PM
    Moderator
  • I have a question.

    The CRM SDK is for CRM 2011 (on premise) or for CRM Online?

    have you tried to connect the plugin registration tool to CRM Online?

    did you launch a listener?

    Help please :)

    Wednesday, May 11, 2011 3:22 PM
  • The SDK is for both online and on-premise.  I don't know what you mean by launch a listener.

    I just had used the discovery server for the host:

    https://dev.crm.dynamics.com  (North America)

    https://dev.crm4.dynamics.com   (EMEA)

    https://dev.crm5.dynamics.com  (APAC)

    and used my windows live credentials.  It shoudl work if your user is a valid user in CRM with the appropriate privileges and you don't have issues regarding the time issue mentioned earlier and there was that windows 7 issue with the auto adjust for daylight savings that required me to turn my clock back one hour to connect, but that was only on one machine.


    Jamie Miley
    http://mileyja.blogspot.com
    Linked-In Profile
    Follow Me on Twitter!
    Wednesday, May 11, 2011 3:35 PM
    Moderator
  • but before launching The plugin registration tool , you have to ebnable a listener and to configure the access control of azure. can you confim me that? did you do that before?
    Thursday, May 12, 2011 2:35 PM
  • There were two issues with two different accounts:

    1. Account 1 - Unknown issues using my primary admin account.  Created account 2 for testing and workaround.  MS Still investigating.
    2. Account 2 - Passwords greater than 15 character's don't appear to be supported and failed during testing.  Works fine on the web, breaks with the registration tool.  Solution was to shorten the password which happened randomly during troubleshooting with Microsoft.

    Hope this helps!

    • Marked as answer by Jim Glass Jr Tuesday, May 17, 2011 4:15 PM
    Monday, May 16, 2011 11:43 PM
  • Ok, so YoungAzure, if I am understanding properly you are trying to configure azure integration with CRM.  I just went through the how to article I am about to post and got it working with the two way listener scenario.  There is also a good overview msdn article I will also include.

    The one thing I want to mention is that the listener does not have to be in place for the plugin registration tool to work.  The plugin registration tool is what you use to register service endpoints or your azure-aware plugins.

    http://msdn.microsoft.com/en-us/library/gg309276.agspx

    http://blogs.msdn.com/b/crm/archive/2011/02/18/windows-azure-appfabric-integration-with-microsoft-dynamics-crm-step-by-step.aspx


    Jamie Miley
    http://mileyja.blogspot.com
    Linked-In Profile
    Follow Me on Twitter!
    Tuesday, May 17, 2011 12:38 AM
    Moderator
  • Okay Guys. But all what you told me is already done.

    The problem is : when i launch The two way listener or the Plugin regsitration tool i have problem of connections. maybe Agile IT is right about the length of the password.

    but why  the listener doesn'ty work? (failed to connect or to authenticate error message)

    And why the plugin doesnt connect?

    apparently there is a difference between integration CRM and CRM ONLINE ....

    HELP :D

    Tuesday, May 17, 2011 2:53 PM
  • Hello guys,

    I just found a solution for this issue.

    I updated the Connections.config file and change the discover like this :

    <Url>https://disco.crm4.dynamics.com/XRMServices/2011/Discovery.svc</Url>

    for the EMEA CRM Online and it works like a charm :-)


    Fab

    • Proposed as answer by Fabson69 Wednesday, February 6, 2013 9:29 AM
    Wednesday, February 6, 2013 9:29 AM