Results 1 to 5 of 5

Thread: Invalid signature for signature method HMAC-SHA1

  1. #1
    Join Date
    May 2012
    Posts
    27

    Default Invalid signature for signature method HMAC-SHA1

    I periodically get this when testing and from what I can tell the input values match but the signatures don't

    Douglas

  2. #2
    Join Date
    May 2012
    Posts
    27

    Default

    I figured it out.

    Turns out that the HMAC signature can have spaces which means that you need to URL encode the signature prior to adding it to the header.

    Also the token secret comes back encoded so that needs to be decoded prior to signing.

  3. #3
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    There was a fix last week for spaces in signatures. Can you try a snapshot and verify that it works in your use case (hopefully out of the box)?

  4. #4
    Join Date
    Apr 2013
    Posts
    2

    Default

    Quote Originally Posted by thedug View Post
    I figured it out.

    Turns out that the HMAC signature can have spaces which means that you need to URL encode the signature prior to adding it to the header.

    Also the token secret comes back encoded so that needs to be decoded prior to signing.
    @thedug, did you notice this issue on `spring-security-oauth-3.19.jar`?

    Thanks.

  5. #5
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    3.19 is probably old code from the codehaus days. Please update to the latest from github/maven (org.springframework.security.oauth:spring-security-oauth).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •