Client Credentials
Using client credentials grant type
Client Credentials
The Client Credentials grant type is used by clients to obtain an access token outside of the context of a user. The client application is assumed to be the resource owner and the access request is to the application’s resources.
How it works
The following diagram describes the Client Credential flow:
What you need
You will need the following information from the Developer Console.
- Client name
- Client id
- Client secret
Token Request
Request
post
https://id.trimble.com/oauth/token
Header
Header | Description |
---|---|
Authorization | Basic credentials |
Content-Type | application/x-www-form-urlencoded |
Body
Body is x-www-form-urlencoded
with the following fields:
Field | Description |
---|---|
grant_type | client_credentials |
scope | Client name |
Examples
The following are examples of token requests using the Client Credentials grant type.
HTTP
POST /oauth/token HTTP/1.1Host: id.trimble.comContent-Type: application/x-www-form-urlencodedAuthorization: Basic {credentials}Content-Length: 89
grant_type=client_credentials&scope={Client name}
Postman
Fork this Postman collection into your own workspace to quickly get started using Client Credentials.
You need the following from your Developer Console application:
- Client name
- Client id
- Client secret
cURL
# Your application credentialsclient_name="your client name"client_id="your client id"client_secret="your client secret"
encoded_credentials=$(echo -n "$client_id:$client_secret" | base64)
curl --location "https://id.trimble.com/oauth/token" \--header "Content-Type: application/x-www-form-urlencoded" \--header "Authorization: Basic $encoded_credentials" \--data-urlencode "grant_type=client_credentials" \--data-urlencode "scope=$client_name"
Sample Response
{ "token_type": "bearer", "expires_in": 3600, "access_token": "eyJhbGciOiJ...LaHpfIpRAzHakV2ossbnpA"}