Read current authentication options.
Organization-Id | string (ResourceId) <= 50 characters Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 Organization identifier in scope of which need to perform request (if not specified, the default organization will be used). |
Rate-Limit-Limit | integer The number of allowed requests in the current period. |
Rate-Limit-Remaining | integer The number of remaining requests in the current period. |
Rate-Limit-Reset | string The date in format defined by RFC 822 when the current period will reset. |
passwordPattern | string Allowed password pattern. |
credentialTtl | integer The default lifetime of the credential in seconds. |
authTokenTtl | integer The default lifetime of the auth-token in seconds. |
resetTokenTtl | integer The default lifetime of the reset-token in seconds. |
otpRequired | boolean Should OTP be required to exchange token. |
$authenticationOptions = $client->authenticationOptions()->load();
[- {
- "passwordPattern": "string",
- "credentialTtl": 0,
- "authTokenTtl": 0,
- "resetTokenTtl": 0,
- "otpRequired": true
}
]
Change options.
Organization-Id | string (ResourceId) <= 50 characters Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 Organization identifier in scope of which need to perform request (if not specified, the default organization will be used). |
Authentication Options resource.
passwordPattern | string Allowed password pattern. |
credentialTtl | integer The default lifetime of the credential in seconds. |
authTokenTtl | integer The default lifetime of the auth-token in seconds. |
resetTokenTtl | integer The default lifetime of the reset-token in seconds. |
otpRequired | boolean Should OTP be required to exchange token. |
Rate-Limit-Limit | integer The number of allowed requests in the current period. |
Rate-Limit-Remaining | integer The number of remaining requests in the current period. |
Rate-Limit-Reset | string The date in format defined by RFC 822 when the current period will reset. |
passwordPattern | string Allowed password pattern. |
credentialTtl | integer The default lifetime of the credential in seconds. |
authTokenTtl | integer The default lifetime of the auth-token in seconds. |
resetTokenTtl | integer The default lifetime of the reset-token in seconds. |
otpRequired | boolean Should OTP be required to exchange token. |
{- "passwordPattern": "string",
- "credentialTtl": 0,
- "authTokenTtl": 0,
- "resetTokenTtl": 0,
- "otpRequired": true
}
{- "passwordPattern": "string",
- "credentialTtl": 0,
- "authTokenTtl": 0,
- "resetTokenTtl": 0,
- "otpRequired": true
}
Retrieve a list of auth tokens.
limit | integer [ 0 .. 1000 ] The collection items limit. |
offset | integer >= 0 The collection items offset. |
Organization-Id | string (ResourceId) <= 50 characters Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 Organization identifier in scope of which need to perform request (if not specified, the default organization will be used). |
Rate-Limit-Limit | integer The number of allowed requests in the current period. |
Rate-Limit-Remaining | integer The number of remaining requests in the current period. |
Rate-Limit-Reset | string The date in format defined by RFC 822 when the current period will reset. |
Pagination-Total | integer Total items count. |
Pagination-Limit | integer Items per page limit. |
Pagination-Offset | integer Pagination offset. |
token | string The token identifier string. |
otpRequired | boolean Should OTP be required to exchange this token. |
credentialId | string <= 50 characters The credential's ID. |
username required | string The token's username. |
customerId | string <= 50 characters The token's customer ID. |
expiredTime | string <date-time> Token's expired time. |
Array of objects (SelfLink) non-empty The links related to resource. |
$authenticationTokens = $client->authenticationTokens()->search([ 'filter' => 'customerId:testCustomer', ]);
[- {
- "token": "string",
- "otpRequired": true,
- "credentialId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21"
}
]
Login a customer.
Organization-Id | string (ResourceId) <= 50 characters Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 Organization identifier in scope of which need to perform request (if not specified, the default organization will be used). |
AuthenticationToken resource.
mode | string Default: "password" The token's generation mode. password password passwordless |
otpRequired | boolean Should OTP be required to exchange this token. |
username required | string The token's username. |
password required | string <password> The token's password. |
expiredTime | string <date-time> Token's expired time. |
Rate-Limit-Limit | integer The number of allowed requests in the current period. |
Rate-Limit-Remaining | integer The number of remaining requests in the current period. |
Rate-Limit-Reset | string The date in format defined by RFC 822 when the current period will reset. |
token | string The token identifier string. |
otpRequired | boolean Should OTP be required to exchange this token. |
credentialId | string <= 50 characters The credential's ID. |
username required | string The token's username. |
customerId | string <= 50 characters The token's customer ID. |
expiredTime | string <date-time> Token's expired time. |
Array of objects (SelfLink) non-empty The links related to resource. |
{- "mode": "password",
- "otpRequired": true,
- "username": "string",
- "password": "pa$$word",
- "expiredTime": "2019-08-24T14:15:22Z"
}
{- "token": "string",
- "otpRequired": true,
- "credentialId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "username": "string",
- "customerId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "expiredTime": "2019-08-24T14:15:22Z",
- "_links": [
- {
- "rel": "self",
- "href": "string"
}
], - "mode": "password"
}
Verify an authentication token.
token required | string The token identifier string. |
Organization-Id | string (ResourceId) <= 50 characters Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 Organization identifier in scope of which need to perform request (if not specified, the default organization will be used). |
Rate-Limit-Limit | integer The number of allowed requests in the current period. |
Rate-Limit-Remaining | integer The number of remaining requests in the current period. |
Rate-Limit-Reset | string The date in format defined by RFC 822 when the current period will reset. |
token | string The token identifier string. |
otpRequired | boolean Should OTP be required to exchange this token. |
credentialId | string <= 50 characters The credential's ID. |
username required | string The token's username. |
customerId | string <= 50 characters The token's customer ID. |
expiredTime | string <date-time> Token's expired time. |
Array of objects (SelfLink) non-empty The links related to resource. |
$isVerified = $client->authenticationTokens()->verify('token');
{- "token": "string",
- "otpRequired": true,
- "credentialId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "username": "string",
- "customerId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "expiredTime": "2019-08-24T14:15:22Z",
- "_links": [
- {
- "rel": "self",
- "href": "string"
}
], - "mode": "password"
}
Logout a customer.
token required | string The token identifier string. |
Organization-Id | string (ResourceId) <= 50 characters Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 Organization identifier in scope of which need to perform request (if not specified, the default organization will be used). |
$client->authenticationTokens()->logout('token');
{- "status": 400,
- "title": "string",
- "detail": "string",
- "error": "string"
}
Exchange Authentication Token for JWT.
It will also invalidate an Authentication Token by default (so it can only be exchanged once).
token required | string The token identifier string. |
Organization-Id | string (ResourceId) <= 50 characters Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 Organization identifier in scope of which need to perform request (if not specified, the default organization will be used). |
invalidate | boolean Default: true Whether to invalidate token after exchange or not. |
oneTimePassword | string^[0-9]{6}$ The one time password sent via an email. Should contain digits only. |
Array of objects (Acl) | |
object | |
expiredTime | string <date-time> Session expired time. Defaults to one hour. |
Rate-Limit-Limit | integer The number of allowed requests in the current period. |
Rate-Limit-Remaining | integer The number of remaining requests in the current period. |
Rate-Limit-Reset | string The date in format defined by RFC 822 when the current period will reset. |
id | string <= 50 characters The session identifier string. |
type | string Value: "customer" Session type. |
token | string The session's token used for authentication. |
customerId | string <= 50 characters The customer's ID. |
Array of objects (Acl) | |
object | |
createdTime | string <date-time> Session created time. |
updatedTime | string <date-time> Session updated time. |
expiredTime | string <date-time> Session expired time. Defaults to one hour. |
Array of objects (CustomerLink) non-empty The links related to resource. |
{- "invalidate": true,
- "oneTimePassword": "123456",
- "acl": [
- {
- "scope": {
- "organizationId": [
- "organizationId-id-1"
]
}, - "permissions": [
- "PostFile",
- "StorefrontGetAccount",
- "StorefrontGetWebsite",
- "StorefrontGetKycDocumentCollection",
- "StorefrontGetKycDocument",
- "StorefrontPostKycDocument"
]
}
], - "customClaims": {
- "documents": [
- "identity-proof",
- "address-proof"
],
}, - "expiredTime": "2019-08-24T14:15:22Z"
}
{- "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "type": "customer",
- "token": "string",
- "customerId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "acl": [
- {
- "scope": {
- "organizationId": [
- "organizationId-id-1"
]
}, - "permissions": [
- "PostFile",
- "StorefrontGetAccount",
- "StorefrontGetWebsite",
- "StorefrontGetKycDocumentCollection",
- "StorefrontGetKycDocument",
- "StorefrontPostKycDocument"
]
}
], - "customClaims": {
- "documents": [
- "identity-proof",
- "address-proof"
],
}, - "createdTime": "2019-08-24T14:15:22Z",
- "updatedTime": "2019-08-24T14:15:22Z",
- "expiredTime": "2019-08-24T14:15:22Z",
- "_links": [
- {
- "rel": "customer",
- "href": "string"
}
]
}
Retrieve a list of credentials.
limit | integer [ 0 .. 1000 ] The collection items limit. |
offset | integer >= 0 The collection items offset. |
Organization-Id | string (ResourceId) <= 50 characters Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 Organization identifier in scope of which need to perform request (if not specified, the default organization will be used). |
Rate-Limit-Limit | integer The number of allowed requests in the current period. |
Rate-Limit-Remaining | integer The number of remaining requests in the current period. |
Rate-Limit-Reset | string The date in format defined by RFC 822 when the current period will reset. |
Pagination-Total | integer Total items count. |
Pagination-Limit | integer Items per page limit. |
Pagination-Offset | integer Pagination offset. |
id | string <= 50 characters The credential identifier string. |
username required | string Credential's username. |
customerId required | string The credential's customer ID. |
expiredTime | string <date-time> The credential's expired time. |
Array of SelfLink (object) or CustomerLink (object) non-empty The links related to resource. |
$customerCredentials = $client->customerCredentials()->search([ 'filter' => 'customerId:testCustomer', ]);
[- {
- "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "username": "string",
- "customerId": "string",
- "expiredTime": "2019-08-24T14:15:22Z",
- "_links": [
- {
- "rel": "self",
- "href": "string"
}
]
}
]
Create a credential.
Organization-Id | string (ResourceId) <= 50 characters Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 Organization identifier in scope of which need to perform request (if not specified, the default organization will be used). |
Credential resource.
username required | string Credential's username. |
password required | string <password> The credential's password. |
customerId required | string The credential's customer ID. |
expiredTime | string <date-time> The credential's expired time. |
Rate-Limit-Limit | integer The number of allowed requests in the current period. |
Rate-Limit-Remaining | integer The number of remaining requests in the current period. |
Rate-Limit-Reset | string The date in format defined by RFC 822 when the current period will reset. |
id | string <= 50 characters The credential identifier string. |
username required | string Credential's username. |
customerId required | string The credential's customer ID. |
expiredTime | string <date-time> The credential's expired time. |
Array of SelfLink (object) or CustomerLink (object) non-empty The links related to resource. |
{- "username": "string",
- "password": "pa$$word",
- "customerId": "string",
- "expiredTime": "2019-08-24T14:15:22Z"
}
{- "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "username": "string",
- "customerId": "string",
- "expiredTime": "2019-08-24T14:15:22Z",
- "_links": [
- {
- "rel": "self",
- "href": "string"
}
]
}
Retrieve a credential with specified identifier string.
id required | string <= 50 characters ^[@~\-\.\w]+$ The resource identifier string. |
Organization-Id | string (ResourceId) <= 50 characters Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 Organization identifier in scope of which need to perform request (if not specified, the default organization will be used). |
Rate-Limit-Limit | integer The number of allowed requests in the current period. |
Rate-Limit-Remaining | integer The number of remaining requests in the current period. |
Rate-Limit-Reset | string The date in format defined by RFC 822 when the current period will reset. |
id | string <= 50 characters The credential identifier string. |
username required | string Credential's username. |
customerId required | string The credential's customer ID. |
expiredTime | string <date-time> The credential's expired time. |
Array of SelfLink (object) or CustomerLink (object) non-empty The links related to resource. |
$customerCredential = $client->customerCredentials()->load('credentialId');
{- "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "username": "string",
- "customerId": "string",
- "expiredTime": "2019-08-24T14:15:22Z",
- "_links": [
- {
- "rel": "self",
- "href": "string"
}
]
}
Create or update a credential with predefined identifier string.
id required | string <= 50 characters ^[@~\-\.\w]+$ The resource identifier string. |
Organization-Id | string (ResourceId) <= 50 characters Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 Organization identifier in scope of which need to perform request (if not specified, the default organization will be used). |
Credential resource.
username required | string Credential's username. |
password required | string <password> The credential's password. |
customerId required | string The credential's customer ID. |
expiredTime | string <date-time> The credential's expired time. |
Rate-Limit-Limit | integer The number of allowed requests in the current period. |
Rate-Limit-Remaining | integer The number of remaining requests in the current period. |
Rate-Limit-Reset | string The date in format defined by RFC 822 when the current period will reset. |
id | string <= 50 characters The credential identifier string. |
username required | string Credential's username. |
customerId required | string The credential's customer ID. |
expiredTime | string <date-time> The credential's expired time. |
Array of SelfLink (object) or CustomerLink (object) non-empty The links related to resource. |
Rate-Limit-Limit | integer The number of allowed requests in the current period. |
Rate-Limit-Remaining | integer The number of remaining requests in the current period. |
Rate-Limit-Reset | string The date in format defined by RFC 822 when the current period will reset. |
id | string <= 50 characters The credential identifier string. |
username required | string Credential's username. |
customerId required | string The credential's customer ID. |
expiredTime | string <date-time> The credential's expired time. |
Array of SelfLink (object) or CustomerLink (object) non-empty The links related to resource. |
{- "username": "string",
- "password": "pa$$word",
- "customerId": "string",
- "expiredTime": "2019-08-24T14:15:22Z"
}
{- "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "username": "string",
- "customerId": "string",
- "expiredTime": "2019-08-24T14:15:22Z",
- "_links": [
- {
- "rel": "self",
- "href": "string"
}
]
}
Delete a credential with predefined identifier string.
id required | string <= 50 characters ^[@~\-\.\w]+$ The resource identifier string. |
Organization-Id | string (ResourceId) <= 50 characters Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 Organization identifier in scope of which need to perform request (if not specified, the default organization will be used). |
$client->customerCredentials()->delete('credentialId');
{- "status": 400,
- "title": "string",
- "detail": "string",
- "error": "string"
}
Retrieve a list of tokens.
limit | integer [ 0 .. 1000 ] The collection items limit. |
offset | integer >= 0 The collection items offset. |
Organization-Id | string (ResourceId) <= 50 characters Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 Organization identifier in scope of which need to perform request (if not specified, the default organization will be used). |
Rate-Limit-Limit | integer The number of allowed requests in the current period. |
Rate-Limit-Remaining | integer The number of remaining requests in the current period. |
Rate-Limit-Reset | string The date in format defined by RFC 822 when the current period will reset. |
Pagination-Total | integer Total items count. |
Pagination-Limit | integer Items per page limit. |
Pagination-Offset | integer Pagination offset. |
token | string The token's identifier string. |
username required | string The token's username. |
credentialId | string Token's credential ID. |
expiredTime | string <date-time> Password expired time. |
Array of objects (SelfLink) non-empty The links related to resource. |
// all parameters are optional const firstCollection = await api.customerAuthentication.getAllResetPasswordTokens(); // alternatively you can specify one or more of them const params = {limit: 20, offset: 100}; const secondCollection = await api.customerAuthentication.getAllResetPasswordTokens(params); // access the collection items, each item is a Member secondCollection.items.forEach(token => console.log(token.fields.token));
[- {
- "token": "string",
- "username": "string",
- "credentialId": "string",
- "expiredTime": "2019-08-24T14:15:22Z",
- "_links": [
- {
- "rel": "self",
- "href": "string"
}
]
}
]
Create a Reset Password Token.
Organization-Id | string (ResourceId) <= 50 characters Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 Organization identifier in scope of which need to perform request (if not specified, the default organization will be used). |
ResetPasswordToken resource.
username required | string The token's username. |
expiredTime | string <date-time> Password expired time. |
Rate-Limit-Limit | integer The number of allowed requests in the current period. |
Rate-Limit-Remaining | integer The number of remaining requests in the current period. |
Rate-Limit-Reset | string The date in format defined by RFC 822 when the current period will reset. |
token | string The token's identifier string. |
username required | string The token's username. |
credentialId | string Token's credential ID. |
expiredTime | string <date-time> Password expired time. |
Array of objects (SelfLink) non-empty The links related to resource. |
{- "username": "string",
- "expiredTime": "2019-08-24T14:15:22Z"
}
{- "token": "string",
- "username": "string",
- "credentialId": "string",
- "expiredTime": "2019-08-24T14:15:22Z",
- "_links": [
- {
- "rel": "self",
- "href": "string"
}
]
}
Retrieve a Reset Password Token with specified identifier string.
id required | string <= 50 characters ^[@~\-\.\w]+$ The resource identifier string. |
Organization-Id | string (ResourceId) <= 50 characters Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 Organization identifier in scope of which need to perform request (if not specified, the default organization will be used). |
Rate-Limit-Limit | integer The number of allowed requests in the current period. |
Rate-Limit-Remaining | integer The number of remaining requests in the current period. |
Rate-Limit-Reset | string The date in format defined by RFC 822 when the current period will reset. |
token | string The token's identifier string. |
username required | string The token's username. |
credentialId | string Token's credential ID. |
expiredTime | string <date-time> Password expired time. |
Array of objects (SelfLink) non-empty The links related to resource. |
const token = await api.customerAuthentication.getResetPasswordToken({id: 'my-first-id'}); console.log(token.fields.credential);
{- "token": "string",
- "username": "string",
- "credentialId": "string",
- "expiredTime": "2019-08-24T14:15:22Z",
- "_links": [
- {
- "rel": "self",
- "href": "string"
}
]
}
Delete a Reset Password Token with predefined identifier string.
id required | string <= 50 characters ^[@~\-\.\w]+$ The resource identifier string. |
Organization-Id | string (ResourceId) <= 50 characters Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 Organization identifier in scope of which need to perform request (if not specified, the default organization will be used). |
const request = await api.customerAuthentication.deleteResetPasswordToken({id: 'my-second-key'}); // the request does not return any fields but // you can confirm the success using the status code console.log(request.response.status); // 204
{- "status": 400,
- "title": "string",
- "detail": "string",
- "error": "string"
}