0

I am having trouble with getting SWT Token validated with following code and throws error on line 3

Line 1: var managementUri = ServiceBusEnvironment.CreateServiceUri("https", <myServiceBusNameSpace>, string.Empty);
Line 2: var tokenProvider = TokenProvider.CreateSharedSecretTokenProvider(<...issuerName...>, <...issuerSecret...>);
Line 3: var namespaceManager = new NamespaceManager(managementUri, tokenProvider);

Here is the error: The token provider was unable to provide a security token while accessing ......-sb.accesscontrol.windows.net/WRAPv0.9/. Token provider returned message: 'Error:Code:401:SubCode:T0:Detail:ACS50009: SWT token is invalid.:TraceID:d56b987a-90f4-4c20-8de1-9e2d55107e6c:TimeStamp:2013-08-30 13:56:52Z'.

I passed Service bus Shared Access Key Name and Shared Access Key as issuer name and issuer secrete but same error

I also passed ACS Service Identity Name and symmetric key as issuer name and issuer secrete but same error

I have no clue as why token is not validated. There is hardly any help from Microsoft site on this issues. I looked at ACS error code on MSDN and no help on this issue

I also configured BizTalk Receive location with sb connection string and has the same issue

I appreciate help on this issue and what could be the root cause of this error

SteveC
  • 15,808
  • 23
  • 102
  • 173

1 Answers1

0

Linesh, The above API is only applicable for use with the ACS service identity and symmetric key. Based on the error it is likely a change is needed to the following line of code:

ServiceBusEnvironment.CreateServiceUri("https", <myServiceBusNameSpace>, string.Empty);

Can you replace "https" with "sb" and give it a try?

Abhishek Lal
  • 3,233
  • 1
  • 17
  • 16