Obtaining an access_token
access_token
Send a POST request to the token_endpoint
with the following parameters in the request body:
grant_type
: passwordusername
: the user's usernamepassword
: the user's passwordclient_id
: your client IDscope
: the requested scopes, such asopenid
andprofile
CTC-US
token_endpoint: https://accounts.calamp.com/oauth2/aus190umwbX0NIZv65d6/v1/token
client_id: 0oa63qnii6kCc10Ze5d7
CTC-EU
token_endpoint: https://accounts.calamp.co.uk/oauth2/aus9s1fokCpJoN3jB416/v1/token
client_id: 0oa6snpq4eh3BdzxI417
Example:
curl -X POST https://accounts.calamp.com/oauth2/aus190umwbX0NIZv65d6/v1/token \
-d grant_type=password \
-d username=your-username \
-d password=your-password \
-d client_id=0oa63qnii612345 \
-d scope=openid
The Authorization Server will respond with an access_token
in the response body.
{
"token_type": "Bearer",
"expires_in": 86400,
"access_token": "eyJraWQiOiJ0VD...mcaYWQ",
"scope": "openid",
"id_token": "eyJraWQiOiJ...wpdZg"
}
Note
The
access_token
expires in 24 hours at which time a newaccess_token
needs to be obtained via the authentication process described.