Skip to main content
POST

Headers

DPoP
string
required

DPoP (Demonstrating Proof-of-Possession) proof JWT, signed with the CLI's ephemeral private key. Contains htm (HTTP method), htu (endpoint URI), iat, and jti claims.

Body

clientId
string
required

AWS CLI client identifier. Must match the value used in /v1/authorize.

grantType
enum<string>
required

authorization_code — first token exchange after user approval. refresh_token — silent renewal using a prior refreshToken.

Available options:
authorization_code,
refresh_token
code
string

Required for authorization_code grant. The authorization code from the /v1/authorize redirect.

redirectUri
string<uri>

Required for authorization_code grant. Must exactly match the redirect_uri sent to /v1/authorize.

codeVerifier
string

Required for authorization_code grant. The PKCE code verifier whose SHA-256 hash was sent as code_challenge.

refreshToken
string

Required for refresh_token grant. The refreshToken from a prior response.

Response

Real 15-minute AWS STS credential bundle for the client's isolated AWS account. The CLI caches these in ~/.aws/login/cache/. On authorization_code grants, idToken is also returned; on refresh_token grants it is omitted.

accessToken
object
required

Real AWS STS temporary credential set for the client's isolated AWS account.

tokenType
enum<string>
required

Always aws_sigv4. Indicates these credentials sign requests with AWS SigV4.

Available options:
aws_sigv4
expiresIn
integer
required

Whole seconds remaining until accessToken credentials expire.

Required range: 1 <= x <= 900
Example:

900

refreshToken
string
required

Opaque token used with the refresh_token grant for silent renewal. Valid for an absolute 12-hour window from first login. After 12 hours, aws login must be run again.

idToken
string

JWT identity token. Present on authorization_code grant responses; omitted on refresh_token grant responses.