docs

Redirect User

1.0.0
OpenAPI 3.0.1

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:

  1. Register a new user
  2. Login an existing user
  3. 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.

Server:https://{tenant-space}.auth.scayle.cloud
Client Libraries

Redirect Chains

​

Public GET endpoints for redirect chains

Redirect Chains Operations

Redirect User

​

This endpoint sends the user to the configured Identity Provider. The signed jwt query parameter carries the redirect context (callback URL, target IdP, and optional provider-specific hints). The JWT payload may also carry an optional authUrlParameters object — see the jwt parameter for the full payload description.

Query Parameters

  • The shop ID.

  • A JWT, signed with the shopSecret (HS256), that carries the redirect context. The following fields make up the JWT payload (they are not sent as individual URL query parameters — they travel inside this signed token):

    • callbackUrl (string, required): URL the user is redirected back to after successful authentication.
    • idpKey (string, required): key of the configured Identity Provider to redirect to (e.g. google, apple, okta).
    • clientId (integer, required): client identifier associated with the request.
    • tokenId (string, optional): correlation id for the auth attempt.
    • iat / exp (integer, optional): standard issued-at / expiry timestamps.
    • code_challenge / code_challenge_method (string, optional): PKCE parameters. When both are present, a PKCE flow is used.
    • authUrlParameters (object, optional): a controlled way for the party that builds this redirect JWT (e.g. the storefront integration) to inject provider-specific hints into the final IDP authorization URL — parameters outside the standard OAuth2 flow (e.g. prompt=login, acr_values, ui_locales, audience, locale). Each key/value pair is checked against the Identity Provider's authUrlParametersWhitelist — a per-IDP object of the shape {"<paramName>": ["<allowedValue>", ...]} configured per Identity Provider via the Panel (a dedicated API is available for it). Non-scalar values (nested objects/arrays) are dropped. Whitelist checking is currently soft: non-matching values are logged but still forwarded (strict dropping is planned). Invalid authUrlParameters never cause an error response. Surviving values are appended as query parameters to the IDP auth URL. The object is removed from the JWT that is forwarded to the IDP as the OAuth2 state parameter, and is never persisted. Because these values live inside this signed JWT (not raw URL query parameters), they cannot be tampered with in transit.

Responses

  • Successful redirect to the IDP (target URL in the Location header).

  • Shop not found (unknown shopId), or idpKey does not match an Identity Provider configured for the shop's company.

  • Validation failed. Returned when the query parameters are invalid (missing or malformed shopId / jwt), when the JWT signature or encoding is invalid, or when a required JWT payload field (callbackUrl, idpKey, clientId) is missing.

Request Example for get/v1/auth/external/redirect
curl 'https://TENANT_SPACE.auth.scayle.cloud/v1/auth/external/redirect?shopId=105&jwt=Decoded%20JWT%20payload%20(sign%20this%20with%20the%20shopSecret%20to%20produce%20the%20jwt%20value)%3A%0A%7B%0A%20%20%22callbackUrl%22%3A%20%22https%3A%2F%2Fwww.example-shop.com%2Fcheckout%2Fidp-callback%22%2C%0A%20%20%22idpKey%22%3A%20%22google%22%2C%0A%20%20%22clientId%22%3A%201%2C%0A%20%20%22tokenId%22%3A%20%22abcd1234%22%2C%0A%20%20%22iat%22%3A%201730380706%2C%0A%20%20%22exp%22%3A%201730381606%2C%0A%20%20%22authUrlParameters%22%3A%20%7B%0A%20%20%20%20%22audience%22%3A%20%22https%3A%2F%2Fcheckout.api.scayle.cloud%2Fuser%22%2C%0A%20%20%20%20%22locale%22%3A%20%22de-DE%22%0A%20%20%7D%0A%7D'
No Body

Last updated: November 27, 2026