signicat-client-ts
Version:
Community TypeScript client for Signicat Authentication REST API with automatic token management
109 lines (108 loc) • 4.79 kB
TypeScript
import type { CallbackUrls } from "./CallbackUrls";
import type { EncryptionKey } from "./EncryptionKey";
import type { PaymentPrefillData } from "./PaymentPrefillData";
import type { PrefilledInput } from "./PrefilledInput";
import type { AuthenticationProviderValue } from "./AuthenticationProviders";
/**
* The Session to be created.
*/
export type SessionRequestDto = {
prefilledInput?: PrefilledInput;
/**
* Additional parameters that modify the authentication flow. Depends on selected IdP.
* See <a href="https://developer.signicat.com/identity-methods/">developer documentation</a> for details.
*/
additionalParameters?: Record<string, string> | null;
callbackUrls?: CallbackUrls;
encryptionPublicKey?: EncryptionKey;
/**
* Specifies the LoA (Level of Assurance).
*/
requestedLoa?: SessionRequestDto.requestedLoa | null;
/**
* A set of support optional tags to group and filter webhooks.
* The maximum length for each tag is 100.
*/
tags?: Array<string> | null;
/**
* If specified the embedded view will return to this URL after authentication is completed (successfully or not). If not specified, a success or error screen will be shown inside the embedded view.
*/
returnUrl?: string | null;
/**
* Specify the parent domains that will embed the authentication. This will be used for content security frame ancestor header if set, as an extra security mechanism to protect against clickjacking.
*/
embeddedParentDomains?: Array<string> | null;
paymentPrefillData?: PaymentPrefillData;
/**
* A list of Identity Providers (IdPs) that can be used for authentication.
* If not specified, the end-user will be able to choose from all IdPs associated with your Signicat account.
* The maximum length for each Provider is 30.
*
* @example ["nbid", "sbid", "idin"] // Norwegian BankID, Swedish BankID, iDIN
*/
allowedProviders?: Array<AuthenticationProviderValue> | null;
/**
* The desired language for the UI. Expected format ISO 639-1.
* If the requested language is not available, it will automatically default to English (en).
* Some IdPs may have a different fallback language due to regional considerations.
*/
language?: string | null;
/**
* The selected flow used for this specific authentication session.
* To learn more about using the ```headless``` flow with Swedish BankID, please refer to <a href="/identity-methods/sbid/integration-guide/auth-rest-api/headless/">this example</a>.
* If flow is set to Redirect the field CallbackUrls is required.
*/
flow: SessionRequestDto.flow;
/**
* The themeId you want to use for this specific authentication session.
* If not specified, the default theme for your account will be used.
*/
themeId?: string | null;
/**
* The attributes you wish to get back from the authentication of the end-user.
* To find a list of which attributes can be requested, please see documentation for that specific ID method which
* can be found on <a href="https://developer.signicat.com/identity-methods/">https://developer.signicat.com/identity-methods/</a>.
*
* Defaults to empty.
*/
requestedAttributes: Array<string>;
/**
* An external reference for you, will be returned as a URL parameter on callbackUrls.
*/
externalReference?: string | null;
/**
* An usage external reference for you to group your billing.
*/
usageReference?: string | null;
/**
* Lifetime of session in seconds (Default is 1200 seconds). It has a soft-minimum value of 300 seconds, which means if the value set is
* less then 300, it will be automatically set to 300 seconds.
*/
sessionLifetime?: number | null;
/**
* This specifies the domain you want to use for this specific session.
* The domain will be visible in the end-user's browser.
* This domain needs to be correctly configured on your account!
*/
requestDomain?: string | null;
};
export declare namespace SessionRequestDto {
/**
* Specifies the LoA (Level of Assurance).
*/
enum requestedLoa {
LOW = "low",
SUBSTANTIAL = "substantial",
HIGH = "high"
}
/**
* The selected flow used for this specific authentication session.
* To learn more about using the ```headless``` flow with Swedish BankID, please refer to <a href="/identity-methods/sbid/integration-guide/auth-rest-api/headless/">this example</a>.
* If flow is set to Redirect the field CallbackUrls is required.
*/
enum flow {
HEADLESS = "headless",
REDIRECT = "redirect",
EMBEDDED = "embedded"
}
}