トークン発行
Description
有効なトークン情報を取得します。
発行されたトークンは24時間有効になります。
Request URL
Identity Service API v2 POST v2.0/tokens
Request Json
{ "auth": { "passwordCredentials": { "username": "ユーザー名", "password": "ユーザーパスワード" }, "tenantId": "テナントID" } }
Request Parameters
Parameter | Value | Style | Description |
---|---|---|---|
username | ユーザー名 | plain | コントロールパネルのログインユーザー名 |
password | パスワード | plain | コントロールパネルのログインパスワード |
tenantId (Optional) | テナントID | plain | コントロールパネルにてAPI情報をご確認ください。 |
tenantid(Optional) | テナント名 | plain | コントロールパネルにてAPI情報をご確認ください。 |
Response
-
Normal response codes
200
Example
-
Request
curl -i -X POST \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -d '{"auth":{"passwordCredentials":{"username":"ユーザー名","password":"パスワード"},"tenantId":"テナントID"}}' \ 認証エンドポイント/tokens
-
Response
HTTP/1.1 200 OK
Date: Mon, 26 Mar 2018 02:49:07 GMT
Server: Apache
Content-Length: 1620
Content-Type: application/json
{
"access":{
"token":{
"issued_at":"2018-03-26T02:49:08.269627",
"expires":"2018-03-27T02:49:08Z",
"id":"トークンID",
"tenant":{
"id":"テナントID",
"enabled":true,
"domain_id":"gac",
"name":"テナント名",
"description":""
},
"audit_ids":[
"M-dxfHUjQXKDKfr3OvfYSw"
]
},
"serviceCatalog":[
{
"endpoints":[
{
"region":"jpt1",
"publicURL":"サーバー操作エンドポイント"
}
],
"endpoints_links":[],
"type":"compute",
"name":"Compute Service"
},
{
"endpoints":[
{
"region":"jpt1",
"publicURL":"ネットワークエンドポイント"
}
],
"endpoints_links":[],
"type":"network",
"name":"Network Service"
},
{
"endpoints":[
{
"region":"jpt1",
"publicURL":"ボリュームエンドポイント"
}
],
"endpoints_links":[],
"type":"volumev2",
"name":"Volume Service"
},
{
"endpoints":[
{
"region":"jpt1",
"publicURL":"イメージエンドポイント"
}
],
"endpoints_links":[],
"type":"image",
"name":"Image Service"
},
{
"endpoints":[
{
"region":"jpt1",
"publicURL":"オブジェクトストレージエンドポイント"
}
],
"endpoints_links":[],
"type":"object-store",
"name":"Object Storage Service"
},
{
"endpoints":[
{
"region":"jpt1",
"publicURL":"認証エンドポイント"
}
],
"endpoints_links":[],
"type":"identity",
"name":"Identity Service"
}
],
"user":{
"username":"ユーザー名",
"roles_links":[],
"id":"1bf87f588e254fe0b4db36dba2907d88",
"roles":[
{
"name":"SwiftOperator"
},
{
"name":"_member_"
}
],
"name":"ユーザー名"
},
"metadata":{
"is_admin":0,
"roles":[
"ea04ba71916e434c8fdc1b9c327f8dae",
"e79e6014598348f192a03f8456a084a3"
]
}
}
}