Read current authentication options.
Current authentication options was retrieved successfully.
Unauthorized access, invalid credentials were used.
Access forbidden.
$authenticationOptions = $client->authenticationOptions()->load();
[- {
- "passwordPattern": "string",
- "credentialTtl": 0,
- "authTokenTtl": 0,
- "resetTokenTtl": 0,
- "otpRequired": true
}
]
Change options.
Authentication Options resource.
Authentication Options were updated.
Unauthorized access, invalid credentials were used.
Access forbidden.
Invalid data was sent.
{- "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.
A list of auth tokens was retrieved successfully.
Pagination-Total | integer Total items count. |
Pagination-Limit | integer Items per page limit. |
Pagination-Offset | integer Pagination offset. |
Unauthorized access, invalid credentials were used.
Access forbidden.
$authenticationTokens = $client->authenticationTokens()->search([ 'filter' => 'customerId:testCustomer', ]);
[- {
- "token": "string",
- "otpRequired": true,
- "credentialId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21"
}
]
Login a customer.
AuthenticationToken resource.
Login successful.
Unauthorized access, invalid credentials were used.
Access forbidden.
Invalid data was sent.
{- "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.
Authentication Token was verified.
Unauthorized access, invalid credentials were used.
Access forbidden.
Resource was not found.
$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.
Customer was logged out.
Unauthorized access, invalid credentials were used.
Resource was not found.
$client->authenticationTokens()->logout('token');
{- "status": 401,
- "title": "string",
- "detail": "string",
- "instance": "string"
}
Exchange Authentication Token for JWT.
It will also invalidate an Authentication Token by default (so it can only be exchanged once).
Authentication Token exchanged for JWT.
Unauthorized access, invalid credentials were used.
Access forbidden.
Resource was not found.
{- "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.
A list of Credentials was retrieved successfully.
Pagination-Total | integer Total items count. |
Pagination-Limit | integer Items per page limit. |
Pagination-Offset | integer Pagination offset. |
Unauthorized access, invalid credentials were used.
Access forbidden.
$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.
Credential was created.
Unauthorized access, invalid credentials were used.
Access forbidden.
Invalid data was sent.
{- "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.
Credential was retrieved successfully.
Unauthorized access, invalid credentials were used.
Access forbidden.
Resource was not found.
$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.
Credential resource.
Credential was updated.
Credential was created.
Unauthorized access, invalid credentials were used.
Access forbidden.
Resource was not found.
Invalid data was sent.
{- "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.
Credential was deleted.
Unauthorized access, invalid credentials were used.
Resource was not found.
$client->customerCredentials()->delete('credentialId');
{- "status": 401,
- "title": "string",
- "detail": "string",
- "instance": "string"
}
Retrieve a list of tokens.
A list of Reset Password Tokens was retrieved successfully.
Pagination-Total | integer Total items count. |
Pagination-Limit | integer Items per page limit. |
Pagination-Offset | integer Pagination offset. |
Unauthorized access, invalid credentials were used.
Access forbidden.
// 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.
Reset Password Token was created.
Unauthorized access, invalid credentials were used.
Access forbidden.
Invalid data was sent.
{- "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.
ResetPasswordToken was retrieved successfully.
Unauthorized access, invalid credentials were used.
Access forbidden.
Resource was not found.
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.
ResetPasswordToken was deleted.
Unauthorized access, invalid credentials were used.
Access forbidden.
Resource was not found.
Conflict.
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": 401,
- "title": "string",
- "detail": "string",
- "instance": "string"
}