Acquire IdP access token
Acquires an access token issued by given IdP for the current user. This operation requires that the IdP is configured to support offline access - issues refresh tokens upon user's login to Onezone, which are later used to acquire new access tokens when they expire. Offline access can be configured by the Onezone admin.
The user must first log in to Onezone using given IdP, otherwise the operation will return a 404 error.
This operation can be invoked on behalf of current user only.
Example cURL requests
Acquire IdP access token
curl -u username:password -X POST \
https://$HOST/api/v3/onezone/user/idp_access_token/github
Path parameters
| Parameter | Type & Description |
|---|---|
| idp required | string IdP identifier. |
Request Examples
onezone-rest-cli acquireIdpAccessToken idp=githubResponses
The access token issued by given IdP.
| Property | Type & Description |
|---|---|
token string The access token. | |
ttl integer Time to live of the token (in seconds). | |
Example
{
"token": "5fc7f98122413e93fc9acbc2cd804961a24501b5820ca6cd3e35b844da9e73b1",
"ttl": 3597
}Invalid request.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Authentication error.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Authorization error.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Resource not found.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Internal server Error.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}