Callback
Once the Loyale SSO process is complete, the user will be redirected to the redirect URL.
You will get 2 query parameters jwt and other. The jwt parameter will contain the Loyale Customer JSON Web Token, which you will use to authenticate the user who made the request on your website.
{redirect_url}?jwt={jwt}&other={other_param}
To complete the authentication, you must call the Loyale Verify Token endpoint server-side.
curl --location --request POST 'https://api.loyale.io/api/Customer/VerifyToken' \
--header 'accept: */*' \
--header 'X-Scheme: {scheme_id}' \
--header 'Authorization: Bearer {auth_token}' \
--header 'Content-Type: application/json-patch+json' \
--data-raw '{"token":"{jwt}"}'
If the jwt is valid you will get back the Loyale Customer ID to link to your website's user.
{
"valid": true,
"customerId": "2d0e88cc-274f-45a4-9c59-ef28142e06af"
}
If it's not valid, the Loyale Customer ID will be null, the property valid will also be false.
{
"valid": false,
"customerId": null
}
Updated 14 days ago