none
ServiceBus 1.0 Connection String RRS feed

  • Question

  • I have set up the ServiceBus Queue within the virtual machine.  When the sample client code runs within the VM, it work fine.  However, if I tried to run the code from my host machine to connect to ServiceBus set up on VM I get the error: "the token provider was unable to provide a security token while accessing... ". 

    My host machine belong to a domain.  The VM is just a workgroup.  The connection string is built as

    Endpoint=sb://WIN-LH8V8RAM74J/MSExample;StsEndpoint=https://WIN-LH8V8RAM74J:9355/MSExample;RuntimePort=9354;ManagementPort=9355;WindowsUsername=IFVMWDEV;WindowsDomain=WIN-LH8V8RAM74J;WindowsPassword=MyPassword

    Monday, May 20, 2013 9:35 PM

Answers

  • No, that's not required. But there are extra work to do in order to have a client in a domain to access an SB server in a workgroup. Please follow the steps below:

    1. Exporting Certificates to Client Machines

    2. In the client code, use OAuthTokenProvider instead of WindowsTokenProvider.

                TokenProvider locakUserTokenProvider = TokenProvider.CreateOAuthTokenProvider(

                    connBuilder.StsEndpoints,

                    new System.Net.NetworkCredential("administrator", " password"));

    3. In order to enable the client machine to access the SB server with host name (this is required, you cannot use IP address of the SB server), add an entry for the SB server into the hosts file on the client machine (it's usually at C:\Windows\System32\drivers\etc\hosts).

    Once you've done these it should work.

    Thanks,

    SGuy

    • Marked as answer by HuaHsin Lu Tuesday, May 21, 2013 6:31 PM
    Monday, May 20, 2013 11:36 PM

All replies

  • Does client (message sender) and ServiceBus need to be on same domain?
    Monday, May 20, 2013 9:56 PM
  • No, that's not required. But there are extra work to do in order to have a client in a domain to access an SB server in a workgroup. Please follow the steps below:

    1. Exporting Certificates to Client Machines

    2. In the client code, use OAuthTokenProvider instead of WindowsTokenProvider.

                TokenProvider locakUserTokenProvider = TokenProvider.CreateOAuthTokenProvider(

                    connBuilder.StsEndpoints,

                    new System.Net.NetworkCredential("administrator", " password"));

    3. In order to enable the client machine to access the SB server with host name (this is required, you cannot use IP address of the SB server), add an entry for the SB server into the hosts file on the client machine (it's usually at C:\Windows\System32\drivers\etc\hosts).

    Once you've done these it should work.

    Thanks,

    SGuy

    • Marked as answer by HuaHsin Lu Tuesday, May 21, 2013 6:31 PM
    Monday, May 20, 2013 11:36 PM
  • I agree with SGuy GE, but if you don't want to change you code ,you also can importing Certificates to you Client machines. of cause, this need you client and sevice bus server in a domain.
    Tuesday, May 21, 2013 2:05 AM