Authentication API
This is the specification of Authentication API. For more information about how to interact with the Authentication API, you can read the respective developer guide.
Getting Started
This API must be only used by backend services
Creating an API Client
First you will need to create a new API client using the SCAYLE Panel to obtain your client_id and client_secret. Make sure to store those credentials safely in your backend.
Authenticating a User
There are three different options on how to authenticate a user:
- Register a new user
- Login an existing user
- Login as a guest customer without a password
All of those endpoints will require you to provide the client_id and client_secret as a Basic Auth header.
Credentials client_id and client_secret don't have any expiration date. After successfully authenticating a user, you will get an access token and a refresh token. Access tokens are valid for 30 days and Refresh Tokens are valid for 60 days.
Validating a token
You will need to call the validation endpoint to check if an access token is still valid.
Refreshing a token
Refreshing a token is done by using the POST token endpoint by using the refresh_token OAuth grant.
You should consider to check the expiration date of the JWT to trigger a refresh early enough.