Class TokenValidator

java.lang.Object
org.imixs.security.oidc.TokenValidator

public class TokenValidator extends Object
The TokenValidator is used to validate OIDC access tokens against the identity provider
  • Constructor Details

    • TokenValidator

      public TokenValidator()
  • Method Details

    • decodeJwtPayload

      public static jakarta.json.JsonObject decodeJwtPayload(String jwt) throws Exception
      Throws:
      Exception
    • isTokenValid

      public static boolean isTokenValid(String jwt, Map<String,com.nimbusds.jose.jwk.RSAKey> publicKeys)
    • extractUsername

      public static String extractUsername(jakarta.json.JsonObject claims, String claimCallerName)
      This method extract the caller name from the claim object. If not provided the method will default to preferred_username|sub|name
      Parameters:
      claims -
      claimCallerName -
      Returns:
    • extractRoles

      public static List<String> extractRoles(jakarta.json.JsonObject claims, String claimPath)
      This method extracts the roles form a given json path. If no path is provided, the method automatically tries to extract the roles based on default locations within the claims.
      Parameters:
      claims -
      claimPath -
      Returns: