Authentication and authorization

Create and manage customer access tokens.

Creating a new customer

post

Creates a new customer account.

Note: The request needs to be authorized with an anonymous access token.


Required scopes

No specific scopes are required.

Authorizations
AuthorizationstringRequired

To generate an anonymous token, check out the 'Requesting an anonymous token' endpoint.

Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Body
emailstring · min: 1Required

Customer email address.

Example: [email protected]
passwordstring · min: 1Required

Customer account password.

Responses
chevron-right
201

Created

application/json

Schema for showing location of the new resource.

idstringOptional

Resource identifier.

post
/customer/{tenant}/signup

Requesting an anonymous token

get

Sends an authentication request and returns an anonymous token. This operation causes creation of a new session-context document.

Anonymous token is valid for one hour. After that time it should be refreshed in order to keep the same session ID associated.

Query parameters
tenantstringRequired

Name of the tenant.

Note: Name of the tenant is always written in lowercase.

Example: {tenant}
client_idstringRequired

Your Emporix API key - client ID.

Example: {client_id}
Responses
get
/customerlogin/auth/anonymous/login
200

The request was successful. An anonymous token is returned.

Refreshing an anonymous token

get

Sends an authentication request and returns new anonymous token with same session ID attached.

This operation causes update of a session-context document with given session ID.

Anonymous token is valid for one hour. After that time, another refresh anonymous token request should be sent.

Query parameters
tenantstringRequired

Name of the tenant.

Note: Name of the tenant is always written in lowercase.

Example: {tenant}
anonymous_tokenstringRequiredDeprecated

NOTE: It's recommended to use refresh_token parameter instead. Anonymous token that needs to be refreshed so that the same session ID will be kept. Provide the value of the access_token you get in response to requesting a token request.

Example: {GOToGKaEKFyR8DokPBwHH0Y3AKCo}
refresh_tokenstringRequired

A refresh token generated when the anonymous token is created.

Example: {7FnviYrxvQWYdzUVBVTvXeNAA4Jy1HPe}
client_idstringRequired

Your Emporix API key - client ID.

Example: {client_id}
Responses
get
/customerlogin/auth/anonymous/refresh
200

The request was successful. An anonymous token is returned.

Logging in a customer

post

Logs in a customer and sends an authentication request. Returns two customer tokens:

  • Customer access token

  • Customer SaaS token

Note: The request needs to be authorized with an anonymous access token.


Required scopes

No specific scopes are required.

Authorizations
AuthorizationstringRequired

To generate an anonymous token, check out the 'Requesting an anonymous token' endpoint.

Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Body
emailstring · min: 1Required

Customer email address.

passwordstring · min: 6Required

Customer account password.

Responses
post
/customer/{tenant}/login

Logging out a customer

get

Logs out a customer and invalidates their customer token.

Note: The request needs to be authorized with a customer access token.


Required scopes

No specific scopes are required.

Authorizations
AuthorizationstringRequired

To generate a customer access token, go to the 'Logging in a customer' endpoint.

Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Query parameters
accessTokenstringRequired

Customer access token to be invalidated.

Responses
get
/customer/{tenant}/logout

No content

Refreshing a customer token

get

Sends an authentication request and returns a refresh token.

Note: The request needs to be authorized with an anonymous access token.


Required scopes

No specific scopes are required.

Authorizations
AuthorizationstringRequired

To generate an anonymous token, check out the 'Requesting an anonymous token' endpoint.

Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Query parameters
refreshTokenstringRequired

Customer refresh token generated when a customer token is requested.

Example: {customer_refresh_token}
legalEntityIdstringOptional

Identifier of the legal entity associated with the user session.

Header parameters
AuthorizationstringRequired

Customer access token generated when the customer token is created.

Example: Bearer {customer_access_token}
Responses
get
/customer/{tenant}/refreshauthtoken

Validate a token

get

Checks whether a token is valid. If the token is invalid, it returns a 401 status code. If the token is valid, it provides the token details.

Authorizations
AuthorizationstringRequired

To generate a customer access token, go to the 'Logging in a customer' endpoint.

Path parameters
tenantstringRequired

Name of the tenant.

Note: Name of the tenant is always written in lowercase.

Example: {tenant}
Header parameters
AuthorizationstringRequired

Customer access token generated upon the customer token creation.

Example: Bearer {customer_access_token}
Responses
get
/customer/{tenant}/validateauthtoken

Exchanging an external access token for an Emporix customer token

post

Exchanges an external access token (for example, from an identity provider such as Keycloak) for an Emporix customer access token.

Note: The request needs to be authorized with an anonymous token.


Required scopes

No specific scopes are required.

Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Query parameters
subjectAccessTokenstringRequired

The subject access token (JWT) to exchange for a customer token.

Example: {subject_access_token}
configstringOptional

Configuration identifier (for example, site_PL). If not provided, the default configuration is used. If a non-existing configuration is provided, the request returns 400 Bad Request.

Example: site_PL
Header parameters
AuthorizationstringRequired

Anonymous token used to authorize the exchange.

Example: Bearer {anonymous_token}
Responses
post
/customer/{tenant}/exchangeauthtoken

Logging in a customer with social login

post

Logs in a customer using an authentication code from Auth0 and retrieves a standard customer token.


Required scopes

No specific scopes are required.

Authorizations
AuthorizationstringRequired

To generate an anonymous token, check out the 'Requesting an anonymous token' endpoint.

Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Query parameters
codestringRequired

The authorization code received from the identity provider.

redirect_uristringRequired

The redirect URI that was used in the initial authorization request.

code_verifierstringOptional

Required only if using PKCE (Proof Key for Code Exchange) flow.

Header parameters
session-idstringOptional

Anonymous customer unique session identifier.

Responses
post
/customer/{tenant}/socialLogin

Last updated

Was this helpful?