Skip to content

Exchange Amazon auth code for tokens

POST
/api/v1/auth/login/amazon/callback
curl --request POST \
--url https://api.totalview.energy/api/v1/auth/login/amazon/callback \
--header 'Content-Type: application/json' \
--data '{ "code": "example", "state": "example", "state_token": "example" }'

Receives the authorization code from Amazon Federate, exchanges it for tokens, verifies the id_token, and logs the user in (or auto-provisions).

Media type application/json
AmazonCallbackSchema
object
code
required
Code
string
state
required
State
string
state_token
required
State Token
string
Example generated
{
"code": "example",
"state": "example",
"state_token": "example"
}

Successful Response

Media type application/json
Example generated
example

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}