The FIB Single Sign-On (SSO) service simplifies and streamlines the login process for your business, enabling seamless authentication through FIB.
This feature is experimental, and is not available in the latest
version yet. Please install the SDK with pre
tag instead:
You can import the SDK classes and types from the sso
entrypoint:
The SingleSignOnSDK
class has a static method that gives you an instance of the SDK configured with your API credentials:
Now you can import FIBSingleSignOn
from anywhere in your project and call its methods to initiate SSO and check the status of the SSO request.
Checkout FIB Single Sign On documentations for more info and how to obtain your credentials
initiate(signal?: AbortSignal)
: Initiates SSO process and returns SSO details including ssoAuthorizationCode.getUserDetails(paymentInput: PaymentInput, accessToken: string, signal?: AbortSignal)
: Gets details of the user linked with the ssoAuthorizationCode.This method sends a request to the First Iraqi Bank's identity server, initiating the SSO process and returning the necessary details including the ssoAuthorizationCode.
The ssoAuthorizationCode
is crucial for the next step, as it allows you to retrieve user details associated with the SSO request.
This method retrieves the user details associated with the provided ssoAuthorizationCode in JSON format.
You don't need to manually type the returned JSON as it is already typed in the SDK.