アクセストークン
アクセストークンは、認証済みのユーザーがシステムにアクセスする際に使用する一時的な認証情報です。
有効期限
アクセストークンの有効期限は1時間(3,600 秒)です。
有効期限が過ぎた場合は、新たなトークンを発行するか、リフレッシュトークンを使って更新を行う必要があります。
実行ユーザーと権限範囲
実行ユーザーと権限範囲は、アクセストークンの発行ユーザーと同一となります。
Warning
発行したアクセストークンは、第三者に知られないように注意してください。
アクセストークン発行
Request
URL
https://gateway-esm.softbrain.com/auth/token
HTTP Method
POST
Request Body
No. | プロパティ名 | 必須 | 項目名 | タイプ | 備考 |
---|---|---|---|---|---|
1 | grantType | ○ | 認可方式 | string | アクセストークン発行を行う際は"password"と指定してください。 |
2 | userId | ○ | ユーザーID | string | esmのログインID |
3 | password | ○ | パスワード | string | esmのログインパスワード |
4 | tenantId | ○ | テナントID | string |
Example
{
"grantType": "password",
"userId": "userId",
"password": "password",
"tenantId": "tenantId"
}
Response
No. | プロパティ名 | 項目名 | タイプ | 備考 |
---|---|---|---|---|
1 | accessToken | アクセストークン | string | |
2 | tokenType | トークンタイプ | string | |
3 | expireIn | 有効期限(秒) | number | |
4 | refreshToken | リフレッシュトークン | string |
Example
{
"accessToken": "ey....",
"tokenType": "BEARER",
"expireIn": 3600,
"refreshToken": "125b25b231b9412997371a30bcff15cb"
}
アクセストークン更新
Request
URL
https://gateway-esm.softbrain.com/auth/token
HTTP Method
POST
Request Body
No. | プロパティ名 | 必須 | 項目名 | タイプ | 備考 |
---|---|---|---|---|---|
1 | grantType | ○ | 認可方式 | string | アクセストークン更新を行う際は"refresh"と指定してください。 |
2 | refreshToken | ○ | リフレッシュトークン | string | 更新対象のアクセストークン発行時に取得したリフレッシュトークンを指定してください。 |
3 | tenantId | ○ | テナントID | string |
Example
{
"grantType": "refresh",
"refreshToken": "125b25b231b9412997371a30bcff15cb",
"tenantId": "tenantId"
}
Response
No. | プロパティ名 | 項目名 | タイプ | 備考 |
---|---|---|---|---|
1 | accessToken | アクセストークン | string | |
2 | tokenType | トークンタイプ | string | |
3 | expireIn | 有効期限(秒) | number | |
4 | refreshToken | リフレッシュトークン | string |
Example
{
"accessToken": "ey....",
"tokenType": "BEARER",
"expireIn": 3600,
"refreshToken": "0dc9b8aeec31480d8ad64af6dc337715"
}