Welcome to the new Box Support website. Check out all the details here on what’s changed.

Getting API access tokens with Golang

New post

Comments

3 comments

  • mwiller

     Per the JWT authentication documentation, the Box API does not currently support the HS256 JWT signature algorithm that you're using.  Could you try changing to RS256 instead and see if that works?

    0
    Comment actions Permalink
  • devftk

     Thank you for your reply. I have changed it to RS256 and am able to successfully generate a JWT. However I am still getting the same HTTP 400 error as a bad request. I think the error may lie in my SendOAuthRequest function. Any ideas of why it could be considered a bad request?

    0
    Comment actions Permalink
  • Box User

    I'm sure this is extremely late, but I'm just working through this now.

    So, you're failing on the

    /oauth2/token

    request? I'm actually getting the token back. (My problem is that I'm getting failures when I use it.)

    Why are you passing the body as a string? Create a bytes.NewReader.

    0
    Comment actions Permalink

Please sign in to leave a comment.