Examine a token
Examines a token provided in serialized form. Returns all the information that can be inferred from the token. Does not verify the token.
This operation has public access.
Example cURL requests
Examine a token
curl -d '{"token": "MDAxNmxvY2F00aW9uIHJlZ2lzdHJ5CjAwM2JpZGVudGlmaW"}' \
-H 'Content-type: application/json' \
https://$HOST/api/v3/onezone/tokens/examine
Request body
The token to be examined (encapsulated in an object).
| Property | Type & Description |
|---|---|
token required string (SerializedToken) The token in serialized form. | |
Request Examples
onezone-rest-cli examineToken token==MDAxNmxvY2F00aW9uRVM2TVo5UlZ5cGFjZV9jcmResponses
Returns the inferred information about the token.
| Property | Type & Description | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
onezoneDomain string (TokenPropertyOnezoneDomain) Domain of the Onezone service that issued the token. | |||||||||||||||||||||||||||||||||||||||
id string (TokenPropertyId) Unique identifier of the token | |||||||||||||||||||||||||||||||||||||||
persistence string (TokenPropertyPersistence) Determines if the token is persistent (named) or not (temporary). Enum: namedtemporary | |||||||||||||||||||||||||||||||||||||||
subject object (TokenPropertySubject) The subject of the token - the user or Oneprovider in whose name the token was issued. The bearer (consumer) of the token adopts the subject's identity when accessing services with that token.
| |||||||||||||||||||||||||||||||||||||||
type object (TokenPropertyTokenType) The type of the token (object) Enum: {accessToken: {}}{identityToken: {}}{inviteToken: {"...": "..."}}
| |||||||||||||||||||||||||||||||||||||||
caveats array of objects (Caveat) A list of caveats that confine the token.
| |||||||||||||||||||||||||||||||||||||||
Example
{
"onezoneDomain": "onezone.example.com",
"id": "2b5d0dd5aa6443a69277b5ce0544fec2",
"persistence": "named",
"subject": {
"type": "user",
"id": "1b510f18b3b05611871c0acdffa9aed4"
},
"type": {
"inviteToken": {
"inviteType": "userJoinCluster",
"clusterId": "fb73f7ceff5abd995357abbe01c812ce"
}
},
"caveats": [
{
"type": "time",
"validUntil": 1571147494
},
{
"type": "ip",
"whitelist": [
"189.34.15.0/8",
"127.0.0.0/24",
"167.73.12.17"
]
}
]
}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."
}
}