Unauthorized Access

The other day I came across a situation which concluded in the most peculiar exception to be thrown when using Service Bus, more specifically an UnauthorizedAccessException with the message of ‘Malformed Authorization Token’. Of course the first intent is to check whether the security credentials are indeed correct or not.

Since the credentials used to instantiate the MessagingFactory were correct, a possible option seemed to be to update the NuGet packages and thus hope that the newer version of the client library would have this issue sorted out. Moreover, because I was working on a restricted network, I also decided to explicitly specify that I want to use the AMQP protocol for ServiceBus rather than anything else and made sure that both 5671 and 5672 ports were open, but this didn’t help at all.

So, what do you think the issue is? 🙂

… wait a minute…

… think about it…

Read More →