BasicUI provides the feature of custom logon and logout.
If you configure the URL of a custom logon page, BasicUI uses the custom logon page, rather than the default logon page.
Custom logon must be used together with a JSON Web Token (JWT) application. For more information, see Access for JWT applications.
1 Custom logon
(1) Configuration:
Make sure that your client is accessed by using a JWT application. For more information, see Access for JWT applications.
You need to specify the URL of the custom logon page and the ID of the JWT application.
(2) How it works:
When a user clicks the logon button, BasicUI is routed to run the
/clogincommand, which embeds the URL of the custom logon page through an inline frame (iframe).After the user logs on, a message that contains the access token is sent from the iframe to BasicUI by calling the parent.postMessage method.
Sample code:
if(parent!=self){
parent.postMessage({
code: 'token',
message: {
access_token: 'xxxx',
refresh_token: 'xxxx',
......
}
}, "*")
}2. Custom logout
(1) Configuration:
(2) How it works:
After you configure the URL of a custom logout page, when a user clicks the logout button, BasicUI is routed to run the
/clogoutcommand, which embeds the URL of the custom logout page through an iframe.After the user logs out on the custom logout page, a message that indicates the logout is sent from the iframe to BasicUI by calling the parent.postMessage method. Then, BasicUI clears the logon information and skips to the homepage.
Sample code:
if (parent !== elf) {
parent.postMessage({
code: 'logout',
}, "*");
}