Generate a JWT token
Last updated
Last updated
With machine-to-machine (M2M) applications such as CLIs, daemons, or services running on your back-end, the system authenticates and authorizes the app rather than a user. In this scenario, typical authentication schemes like username + password or social logins don't make sense. Instead, machine-to-machine apps use the Client Credentials Flow (defined in OAuth 2.0 RFC 6749, section 4.4), in which they pass along their Client IDs and Client Secrets to authenticate themselves and get a token.
Your app authenticates with the Stent Authorization Server using its Client ID and Client Secret (/connect/token
endpoint).
The Stent Authorization Server validates the Client ID and Client Secret.
The Stent Authorization Server responds with an Access Token.
Your application can use the Access Token to call the Stent GraphQL API on behalf of itself.
The GraphQL API responds with requested data.
The HTTP request below allows you to generate a valid JWT authentication token that you can use to access the GraphQL API's schema and data.
A JWT token is valid 30 days after being issued.
Get your Client ID and Client Secret from the Setting > API section of your workspace.
POST
https://auth.stent.io/connect/token
Make sure to replace the values of the client_id
and client_secret
parameters with your own credentials.
Content-Type
string
application/x-www-form-urlencoded
grant_type
string
client_credentials
response_type
string
token
client_id
string
Your Client ID
client_secret
string
Your Client Secret