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://$ZONE_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.
The access token.
Time to live of the token (in seconds).
Example
{
"token": "5fc7f98122413e93fc9acbc2cd804961a24501b5820ca6cd3e35b844da9e73b1",
"ttl": 3597
}Invalid request.
error object Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Authentication error.
error object Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Authorization error.
error object Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Resource not found.
error object Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Internal server Error.
error object Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}