• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Keystone
  5. Token
  6. Checking the Validity of a Specified Token

Checking the Validity of a Specified Token

Function Description

This interface is used to check the validity of a specified token. If the token is valid, detailed token information is returned.

URI

URI format

GET /v3/auth/tokens

Request

  • Request header parameter description

    Parameter

    Mandatory

    Type

    Description

    X-Auth-Token

    Yes

    String

    An authenticated token with the Security Administrator permission.

    NOTE:

    You can verify the validity of your own token without any permission.

    X-Subject-Token

    Yes

    String

    A token to be checked. This token and X-Auth_token belong to the same domain.

  • Query parameter description

    Parameter

    Mandatory

    Type

    Description

    nocatalog

    No

    String

    Indicates that catalog information is not displayed in the token.

  • Sample request
    curl -i -k -H "X-Auth-Token:$token" -H "X-Subject-Token:$token" -X GET https://sample.domain.com/v3/auth/tokens

Response

  • Response header parameter description

    Parameter

    Mandatory

    Type

    Description

    X-Auth-Token

    Yes

    String

    An authenticated token with the Security Administrator permission.

    X-Subject-Token

    Yes

    String

    A token to be checked. This token and X-Auth_token belong to the same domain.

  • Response body parameter description

    Parameter

    Mandatory

    Type

    Description

    token

    Yes

    Object

    Token information list.

  • Token format description

    Parameter

    Mandatory

    Type

    Description

    methods

    Yes

    Array

    Method for obtaining a token.

    expires_at

    Yes

    String

    Time when a token expires.

    issued_at

    Yes

    String

    Time when a token is generated.

    user

    Yes

    Object

    For example:

    "user": { 
          "name": "username", 
          "id": "userid", 
          "domain": { 
             "name": "domainname",
             "id": "domainid"
           } 
        }

    username: name of a user.

    userid: user ID.

    domainname: name of an enterprise account to which a user belongs.

    domainid: domain ID of an enterprise account to which a user belongs.

    domain

    No

    Object

    The system determines whether to return this field based on the scope specified in a request.

    For example:

    "domain": { 
          "name" : "domainame",     
          "id" : "domainid"}

    domainname: indicates the name of an enterprise account.

    domainid: indicates the domain ID of an enterprise account.

    project

    No

    Object

    The system determines whether to return this field based on the scope specified in a request.

    For example:

    "project": { 
          "name": "projectname", 
          "id": "projectid", 
          "domain": { 
             "name": "domainname",
             "id": "domainid"
           } 
       }

    projectname: indicates the name of a project.

    projectid: indicates the ID of a project.

    domainname: indicates the name of an enterprise account to which a project belongs.

    domainid: indicates the domain ID of an enterprise account to which a project belongs.

    roles

    Yes

    Array

    Role array.

    For example:

    "roles" : [{ 
         "name" : "role1", 
         "id" : "roleid1" 
         }, { 
         "name" : "role2", 
         "id" : "roleid2" 
         } 
       ] 
  • Sample response
    {
      "token" : {
        "methods" : ["password"],
        "expires_at" : "2015-11-09T01:42:57.527363Z",
        "issued_at" : "2015-11-09T00:42:57.527404Z",
        "user" : {
          "domain" : {
          "id" : "default",
          "name" : "Default"
          },
          "id" : "ee4dfb6e5540447cb3741905149d9b6e",
          "name" : "admin"
        },
        "domain" : {
           "name" : "Default",
           "id" : "default"
        },
        "roles" : [{
           "name" : "role1",
           "id" : "roleid1"
           }, {
           "name" : "role2",
           "id" : "roleid2"
           }
      ]
      }
    }

Status Codes

Status Code

Description

200

The request is successful.

400

The server failed to process the request.

401

You must enter a username and password to access the requested page.

403

You are forbidden to access the requested page.

404

The server could not find the requested page.

503

Failed to complete the request because the service is unavailable.