SAS Tokens

Jun 27, 2014 at 10:25 PM
Is it possible to use Share Access Signature Tokens with AMQP lite lib?
Coordinator
Jun 29, 2014 at 7:37 AM
If you put the SAS key name and key in the address URL as user name and password, it should work (e.g. amqps://mykey:key@my.servicebus.windows.net). SAS tokens are not currently supported but it will be supported once the proposed AMQP claims based security model becomes standard.

Thanks.

Xin
Oct 9, 2014 at 1:33 PM
Hi Xin,

I tried following:

amqps://MYPolicy:uR/*****amqps://MYPolicy:uR/*****=@mynamespace.servicebus.net

Unfortunately it does not work, because part "MYPolicy:uR" is treated as hostname:port.
The parser is trying to parse "uR" as an int to get the port out of it.

Damir
Coordinator
Oct 9, 2014 at 6:51 PM
This is because you have a slash ('/") in your key. The user name and password need to be URL encoded. Try the following:
amqps://encoded_policyname:encoded_key@mynamespace.servicebus.net Alternatively, you can create the Address object with the constructor that takes individual components instead of a single URL string.