amr
(authentication methods reference) which is a JSON array of strings that indicates the authentication method used during login. It must be present in the ID token’s payload and must contain the value mfa
.
Its values may include any of the pre-defined Authentication Method Reference Values. Because it can contain claims other than mfa
, when validating you must both test for its existence and examine its contents for a value of mfa
.
If a user attempts to access a restricted page and the token shows that the user has not authenticated with MFA, then you can retrigger authentication, which you have configured to trigger MFA using an Action. Once the user provides the second factor, a new ID token that contains the amr
claim is generated and sent to the app.
Claim | Description |
---|---|
exp | Token expiration |
iss | Token issuer |
aud | Intended recipient of the token |
amr | If amr does not exist in the payload or does not contain the value mfa , the user did not log in with MFA. If amr exists in the payload and contains the value mfa , then the user did log in with MFA. |
amr
claim is required except in the following use cases:
amr
claim is injected into the ID token. If the app uses silent authentication or Refresh Tokens for newly issued ID tokens, the amr
claim will not be present because the user previously completed login with MFA.amr
claim. The amr
claim flags the authentication methods used when the user receives the ID Token. In the MFA API authentication process, the application controls the authentication flow and can enforce MFA as needed.CLIENTS_WITH_MFA
variable contains the of the applications you want this Action to apply to. You can remove this (and the if
conditional that follows) if you don’t need it.event.transaction.acr_values
property is an array of strings that contains the authentication context class reference(s) (acr
). This is an optional property that only exists when the application includes it in the authentication request to the . In this example, our web app will include it in the authentication request, but only when a user who has not already authenticated with MFA tries to access salary information. When our web app includes it, it will set a value of http://schemas.openid.net/pape/policies/2007/06/multi-factor
, which indicates that we want the Authorization Server to require MFA, and the api.multifactor
property value that we set in our code will challenge the user for MFA using any of the available methods that have been configured in the tenant. To learn more about the api.multifactor.enable()
method, read Action Triggers: post-login API object.http://schemas.openid.net/pape/policies/2007/06/multi-factor
policy defines an authentication mechanism where the end user authenticates to the Provider by providing more than one authentication factor, or MFA. To learn more, read OpenID Provider Authentication Policy Extension 1.0.amr
claim with a value of mfa
.) If the user has already authenticated with MFA, then the web app will display the restricted page; otherwise, the web app will send a new authentication request that includes the acr_values
parameter with a value of:
http://schemas.openid.net/pape/policies/2007/06/multi-factor
which will trigger the Action.
The web app in this scenario uses the Authorization Code Flow to authenticate, so the request is as follows:
amr
claim with a value of mfa
. To learn how to exchange the code for an ID token, read Add Login Using the Authorization Code Flow.
jwt.verify
), decodes the token, checks whether the payload contains amr
, and if so, logs the results in the console.