Table of Contents

Client Credentials Flow

Note

While Client Credentials flow is technically supported by Pure Farming, at the present time it cannot be used to access data, and is included here for the sake of completeness.

Client Credentials flow, allows a client to authenticate (as itself, not as a user). 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 client credentials 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=client_credentials&client_id=<<your client id>>&client_secret=<<your client secret>>&scope=<<desired scopes>> \
     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.