0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Cognito の ID Pools から Credentials を持ってくる(Curlで)

Posted at

特に認証をしない匿名ユーザ向けの手順です

TL; DR

手順

IdentityPoolId から IdentityId を取得

curl -X POST \
    https://cognito-identity.ap-northeast-1.amazonaws.com \
    -H 'Content-Type: application/x-amz-json-1.1' \
    -H 'x-amz-target: AWSCognitoIdentityService.GetId' \
    -d '{ "IdentityPoolId": "ap-northeast-1:12341234-4321-4321-4321-123412341234" }'

↑で取得した IdentityId から Credentials(AccessKeyId, SecretKey, SessionToken, Expiration) を取得

curl -X POST \
    https://cognito-identity.ap-northeast-1.amazonaws.com \
    -H 'Content-Type: application/x-amz-json-1.1' \
    -H 'x-amz-target: AWSCognitoIdentityService.GetCredentialsForIdentity' \
    -d '{ "IdentityId": "ap-northeast-1:abcdabcd-4567-4567-4567-abcdabcdabcd" }'

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?