How to Access the Client ID to Customize MFA Page for Different Applications

Problem Statement

We have a classic MFA page and want to access the active application name or the client ID to customize the MFA page differently for different applications in our tenant.

Solution

On the classic MFA page, we have a JWT formatted token inserted into the HTML code with the {{ requestToken }} template variable. If you decode this token, it has an attribute called cliendID. To find out which application has started the MFA request on the hosted page using this template variable.

Sample function to decode the token:

Sample function to decode the internal JWT token to get the active client ID