POST STS Token Exchange Login
Signs a customer in by exchanging a token from your own identity provider, instead of by email and password.
This is a server-to-server call: your backend makes it with OAuth client credentials, sending grant_type token_exchange together with the user's subject_token. You get back the customer account and a MENU token to use for the rest of the session.
If your app uses MENU's own customer accounts, sign in the ordinary way instead — see Customer Sign-In Flow. Signing in through this endpoint also creates the account the first time a given identity appears.
Headers
- Type: stringAcceptrequired
Accept header
- Type: stringAuthorizationrequired
Authorization header
- Type: stringContent
- Type requiredContent-Type header
- Type: stringA
P I - V E R S I O N requiredAPI version
- Type: stringApplicationrequired
Application key
- Type: stringX
- Request - I D requiredUnique request identifier
Body
application/json
- Type: stringgrant
_type - Type: stringsubject
_token - Type: stringsubject
_token _type
Responses
- application/json
Request Example for post/sts/users/sign-in
curl https://api-public-demo.menu.app/api/sts/users/sign-in \
--request POST \
--header 'Accept: application/json' \
--header 'Authorization: ' \
--header 'Content-Type: application/json' \
--header 'API-VERSION: ' \
--header 'Application: ' \
--header 'X-Request-ID: c10b4a70-6274-490d-80a0-03e7bb826937 ' \
--data '{
"grant_type": "token_exchange",
"subject_token": "test-1-dragos.niculescu@partech.com-Dragos-Niculescu-911",
"subject_token_type": "access_token"
}'
{
"status": "OK",
"code": 200,
"data": {
"customer_account": {
"id": "956099f5-d069-4021-9186-1a283685eeec",
"type_id": 1,
"reference_type": "CustomerAccount",
"first_name": "Dragos",
"last_name": "Niculescu",
"email": "dragos.niculescu+11112@partech.com",
"phone_number": "911",
"locale": "en",
"state": 1,
"demographics": [
{}
],
"optin_status_email": 3,
"optin_status_pn": 3,
"has_pending_email_change": false,
"has_pending_phone_number_change": false,
"is_social": false,
"social_login": true,
"updated_at": "2023-09-12 12:10:58",
"created_at": "2023-09-12 12:02:56",
"confirmed": false
},
"token": {
"value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbWVudS1jb3JlLm1lbnU6ODA4NC9hcGkvc3RzL3VzZXJzL3NpZ24taW4iLCJpYXQiOjE2OTQ1MjExMDksImV4cCI6MTY5NDYwNzUwOSwibmJmIjoxNjk0NTIxMTA5LCJqdGkiOiJRc25TMm8xTUVnbUFSN0d2Iiwic3ViIjoiNTA4NzcyMCIsInBydiI6ImNjMzI5MjFhMTU0ODBhMTE3ZDliYmM3MmMwZTEyNTZhNjg1MjQ1OGIiLCJhcHBsaWNhdGlvbl9pZCI6MTA1NSwic2Vzc2lvbl9pZCI6MTU4MDF9.cLTkv1MvHTyDhldGpBoCccSo5fPQILYkWR_CkrB8rYA",
"ttl": "1440",
"refresh_ttl": 2628000,
"issued_token_type": "access_token",
"token_type": "Bearer"
}
}
}