Class AmrUtils

java.lang.Object
org.keycloak.protocol.oidc.utils.AmrUtils

public class AmrUtils extends Object
Author:
Ben Cresitello-Dittmar Utility for parsing authenticator method reference (AMR) values.
  • Constructor Details

    • AmrUtils

      public AmrUtils()
  • Method Details

    • getAuthenticationExecutionReferences

      public static List<String> getAuthenticationExecutionReferences(Map<String,Integer> executions, RealmModel realmModel)
      Get the configured authenticator reference values for the specified executions. If no value is configured for the execution, null is returned instead of throwing an error.
      Parameters:
      executions - List of authenticator execution ids
      realmModel - The realm the executions are configured in
      Returns:
      The list of amr values.
    • isAmrValid

      public static boolean isAmrValid(Map<String,String> config, Integer authTime)
      Check if the AMR is still valid by determining if the execution time + the configured max age is less than the current time
      Parameters:
      config - The authenticator execution config
      authTime - The time that the authentication occurred
      Returns:
      True if the amr value is still valid for this session