Forum Discussion

SD's avatar
SD
Day Hiker II
3 months ago

Access Token Not Granted

Hi  Folks,

I'm trying to access Pure1 through REST API , JWT token is generated using private key and application id . I have verified the JWT through jwt.io. But I'm unable to receive access token from Pure1 using JWT . Getting 405 status code 

7 Replies

    • dstevens's avatar
      dstevens
      Day Hiker III

      SD​ you need to use the following:  oauth2/1.0/token
      not oauth2/token

      Note that "1.0" is missing before /token

  • As mikenelson-pure​ mentioned 405 error code usually indicates the user doesn't have access to the particular object you are trying to access.  If you can post the query you are making, minus your JWT, it would help us help you.

  • Hi SD - the error isn't one related to authentication. It also not a result of passing the token since the process hasn't made it that far. It is more likely an issue with the request itself. I assume you are making the request as a POST to /oauth2/1.0/token, correct? 

      • SD's avatar
        SD
        Day Hiker II

        I figured out I was using incorrect URL, correct one is - https://api.pure1.purestorage.com/api/oauth2/1.0/token  but after using this url in the above code - giving me 401 error code - unauthorized access. Validated the application key, private/public key, everything is correct. Not sure what is stopping to get through. Your expertise is highly appreciated.