Skip to content

Hi, How can I get auth token through Authorization Code Flow or Device Code flow. #3310

Answered by SilenLoc
pismute asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

I can't figure out to get access token through the flows. How can I get?

Best,

What flow are you using?
Which flows can you use?

There is flow that are meant for getting user tokens but as a machine:

Resource Owner Password Flow

Those kinds of flows are what you want here.

Warning

Never use this flow in production scenarios

In such flows you will have to send a body something like this:

curl --request POST \
  --url 'https://your-oauth-provider/oauth/token' \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data grant_type=password \
  --data 'username={username}' \
  --data 'password={password}' \
  --data 'audience={yourApiIdentifier}' \
  --data scope=read:sa…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by pismute
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants