Resource Owner Flow
The Resource Owner flow is a simplified version of the Authorization Code flow. It allows a consumer to request a token if they already know the end users credentials (username and password).
This is generally only enabled for trusted clients, and as such you may need to request that this be enabled for you.
In order to request tokens using the resource owner flow, a POST
request needs to be made to the "token" endpoint.
Example Request
curl -H Content-Type: application/x-www-form-urlencoded \
-d grant_type=password&client_id=<<your client id>>&client_secret=<<your client secret>>&scope=<<desired scopes>>&username=<<username>>&password=<<password>> \
https://signin.test.purefarming.com/auth/realms/moa/protocol/openid-connect/token
Example Response
{
"access_token": "...",
"id_token": "...",
"refresh_token": "...",
"expires_in": 3600
}
The response returned above includes three different tokens, see tokens for more information.
The response also includes the expires_in
value which is the number of seconds until the returned access_token
expires.