locked
40103: Invalid authorization token signature Error registering to Notification Hub

    Question

  • Hi all, I'm using this sample to understand and run toast notifications in my windows store app.

    I've set everything up but I get the error from the subject when registering the app to the service bus. I read on the "requirements" that the Service Bus SDK Preview is needed so I added it but I got the same error (with or without that package).

    I double checked everything and all my credentials look fine.

    Can anybody help me out on this one?

    TIA.

    Regards


    http://about.me/sebagomez


    • Edited by sebastian gomez Saturday, October 19, 2013 2:49 PM missing link
    Saturday, October 19, 2013 2:49 PM

Answers

  • Ok, I feel stupid now, but of course... it had to do with my code/configuration.

    I'll just post the answer here in case somebody faces the same issue, if you do and you get to solve it with my answer please let me know so I don't feel lonely :)

    As the error message clearly says, the token signature was invalid, so I started debugging a little deeper and realized that the getSelfSignedToken function was expecting the sharedKey on the second parameter and I was sending the whole connectionString because when I initialized my NotificationHub I added this:

    Endpoint=sb://mynamespase-ns.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=My7cZ4Yx5thisisbullcrapsJCTJxx+UDc4/qc0=

    And all I really had to add was the SharedAccessKey, which in my case is:

    My7cZ4Yx5thisisbullcrapsJCTJxx+UDc4/qc0=

    So, that solved my issue and I hope it helps somebody else :)

    Regards


    http://about.me/sebagomez

    Saturday, October 19, 2013 5:34 PM

All replies

  • Ok, I feel stupid now, but of course... it had to do with my code/configuration.

    I'll just post the answer here in case somebody faces the same issue, if you do and you get to solve it with my answer please let me know so I don't feel lonely :)

    As the error message clearly says, the token signature was invalid, so I started debugging a little deeper and realized that the getSelfSignedToken function was expecting the sharedKey on the second parameter and I was sending the whole connectionString because when I initialized my NotificationHub I added this:

    Endpoint=sb://mynamespase-ns.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=My7cZ4Yx5thisisbullcrapsJCTJxx+UDc4/qc0=

    And all I really had to add was the SharedAccessKey, which in my case is:

    My7cZ4Yx5thisisbullcrapsJCTJxx+UDc4/qc0=

    So, that solved my issue and I hope it helps somebody else :)

    Regards


    http://about.me/sebagomez

    Saturday, October 19, 2013 5:34 PM
  • Hi sebastian Gomez,

    Thanks for sharing the solution with us. :P

    Best Regards,

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, October 21, 2013 1:09 AM
    Moderator