Retrieves the authentication details, which include the url that is used to start the Authorization code flow.
This is the Authorization Endpoint, used as part of the Authorization Code Grant, with the PKCE extension. This endpoint allows clients to securely authenticate into the Paysafe infrastructure by generating an authorization code, which can then be exchanged for an access token. For an enhanced security all clients must use the PKCE extension with the SHA-256 code challenge method.
authenticate
method with the issued access token.The identity of the partner using the Embedded Wallet.
The query parameters for the authorize request.
The authentication details object, which contains the necessary information for authorization.
// Example usage:
const brandIdentity = 'brand-identity';
const parameters = {
client_id: 'f4db4e70-23fc-49b5-9c16-8792afa45b12',
code_challenge: 'fnA81erDlIx65spDQ881PwGJkabRAcb2Z1aMUrys721'
code_challenge_method: CodeChallengeMethod.S256,
digital_fingerprint: '19e0abfb-590a-4f1f-af9e-bdf48473a123',
state: 'Utwe',
reset_credentials_url: 'https://www.paysafe.com/reset-credentials'
redirect_uri: 'http://www.partner.com/wallet/dashboard'
locale: 'en-US'
login_strategy: LoginStrategy.PIN
};
const authenticationDetails: AuthenticationDetails = authenticationService.getAuthenticationDetails(brandIdentity, parameters);
window.location.href = authenticationDetails.authenticationUrl;
Sends a challenge via a secure communication mechanism as part of the ongoing Embedded or Hybrid SCA process.
A distinct identifier for the SCA authentication event.
The SCA authentication event challenge request.
A Promise that resolves to the SCA authentication event challenge response.
If the HTTP request fails.
// Example usage:
authenticationService.sendScaChallenge(eventId, request)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(`Error sending SCA challenge.`);
});
Submits an Embedded or Hybrid authentication attempt for a Strong Customer Authentication (SCA) event.
A distinct identifier for the SCA authentication event.
The SCA authentication event attempt request.
A Promise that resolves to the SCA authentication event attempt response.
If the HTTP request fails.
// Example usage:
authenticationService.submitScaAttempt(eventId, request)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(`Error submitting SCA attempt.`);
});
Static
getRetrieves the singleton instance of the AuthenticationService class.
The singleton instance of the AuthenticationService class.
// Usage:
const authenticationService = AuthenticationService.getInstance();
Service class for managing authentication related operations.