How to Implement Single Sign On (SSO)
The usual workflow for implementing Single Sign On (SSO) involves the following steps:
Step 1: Authenticate: Obtain an API token by validating your credentials.
Step 2: Get SSO Token: Generate an SSO token for the user.
Step 3: Redirect to eWallet: Redirect the user to the eWallet with the SSO token.
API Endpoints Used
In this guide, you will use the following API endpoint:
Below, you will go through the necessary steps to implement SSO between i-payout's eWallet and your website.
Step 1: Authenticate
To start using i-payout solutions, you will need to authenticate with your API Token. Refer to the Get a Token guide to learn how to:
Step 2: Get SSO Token
Once authenticated, call the Get SSO Token endpoint to generate an SSO token for the user. This token is valid for ten minutes and will be used to seamlessly log the user into the eWallet system. Below, you will find an example request and response for getting the SSO token:
curl --request GET \
--url https://merchantapi.testewallet.com/api/v1/beneficiaries/<BENEFICIARY_TOKEN>/sso-token \
--header 'accept: application/json' \
--header 'content-type: application/json'
{
"isSuccess": true,
"message": "Token generated successfully",
"statusCode": 0,
"logIdentifier": "abc123",
"data": {
"token": "ssoToken123",
"expireInMinutes": 10
}
}
Step 3: Redirect User to eWallet
After obtaining the SSO token, redirect the user to the eWallet using the token. The user will be logged in automatically without needing to re-enter their credentials.
Example Redirect URL:
https://yourdomain.com/ewallet?token=ssoToken123
You should substitute the URL for your i-payout eWallet path and ssoToken123
for the token you retrieved in Step 2.
Updated about 2 months ago