-
Hi, I can't figure out to get access token through the flows. Best, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi @pismute Basically, you should understand which HTTP exchanges are in your workflow. Play your workflow in a browser, use the "Developpers tools" to get a list of HTTP requests, try to write your Hurl file with it. If you can have a list of curl commands also in a script, it should be doable to write a Hurl file from it. If the Hurl file format is too restricted, you can also write a shell script with any invocation (included |
Beta Was this translation helpful? Give feedback.
-
What flow are you using? There is flow that are meant for getting user tokens but as a machine:
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:sample \
--data 'client_id={yourClientId}' \
--data 'client_secret={yourClientSecret}' If you only want to get tokens that are meant for machines that you control:
curl --request POST \
--url 'https://you-oauth-provider/oauth/token' \
--header 'content-type: application/x-www-form-urlencoded' \
--data grant_type=client_credentials \
--data client_id=YOUR_CLIENT_ID \
--data client_secret=YOUR_CLIENT_SECRET \
--data audience=YOUR_API_IDENTIFIER Transform those curl requests to hurl and voila. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your answer. I would like to use Authorization Code Flow or Device Code Flow, |
Beta Was this translation helpful? Give feedback.
What flow are you using?
Which flows can you use?
There is flow that are meant for getting user tokens but as a machine:
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: