Search code examples
gopostmanauth0

getting login acess_token with auth0 to postman


I created an app in Go that includes https server with angular2 based client that uses auth0 for authentication, I have another app written in Go which is the API Server, this API Server has jwt middleware configured for auth0 at explained at https://auth0.com/docs/quickstart/backend/golang.

now... I want to use postman to test requests o my API Server but first I need to authenticate. how do I add authentication to my website to get an access token or something to forward with my API request?

I read the docs but I got really confused. any information regarding the issue would be greatly appreciated.

Using Postman Mac App 4.4.2

thanks!

update

so I installed Authentication API Collections on my Postman Mac App while being logged in to my auth0 account.

now I'm trying to get an access token to be used with the authentication header while posting to my Api Server.

I don't know which method I should use in the collection in order to get an access token.


Solution

  • It's quite interesting and tricky at the same time :)

    First you need to get the token from Auth0 using Postman, remember you can get any info from App Settings in Auth0 enter image description here

    In above picture, you see id_token and access_token. The trick here is to use Id_token to send with your requests, not Access_token. Do it as follow: enter image description here

    As you can see, for any request sending to API, we need to add a header called Authorization with value="Bearer {id_token}". Boom...Job's done :) Hope it helps