Enum Class UserProfileContext

java.lang.Object
java.lang.Enum<UserProfileContext>
org.keycloak.userprofile.UserProfileContext
All Implemented Interfaces:
Serializable, Comparable<UserProfileContext>, Constable

public enum UserProfileContext extends Enum<UserProfileContext>

This interface represents the different contexts from where user profiles are managed. The core contexts are already available here representing the different areas in Keycloak where user profiles are managed.

The context is crucial to drive the conditions that should be respected when managing user profiles. It might be possible to include in the future metadata about contexts. As well as support custom contexts.

Author:
Markus Till
  • Enum Constant Details

    • UPDATE_PROFILE

      public static final UserProfileContext UPDATE_PROFILE
      In this context, a user profile is managed by themselves during an authentication flow such as when updating the user profile.
    • USER_API

      public static final UserProfileContext USER_API
      In this context, a user profile is managed through the management interface such as the Admin API.
    • ACCOUNT

      public static final UserProfileContext ACCOUNT
      In this context, a user profile is managed by themselves through the account console.
    • IDP_REVIEW

      public static final UserProfileContext IDP_REVIEW
      In this context, a user profile is managed by themselves when authenticating through a broker.
    • REGISTRATION

      public static final UserProfileContext REGISTRATION
      In this context, a user profile is managed by themselves when registering to a realm.
    • UPDATE_EMAIL

      public static final UserProfileContext UPDATE_EMAIL
      In this context, a user profile is managed by themselves when updating their email through an application initiated action. In this context, only the UserModel.EMAIL attribute is supported.
  • Method Details

    • values

      public static UserProfileContext[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static UserProfileContext valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isAdminContext

      public boolean isAdminContext()
      Returns:
      true means that this context is applicable to administrators. False means that this context is applicable to regular users
    • canBeAuthFlowContext

      public boolean canBeAuthFlowContext()
      Returns:
      true if context CAN BE part of the authentication flow
    • isResetEmailVerified

      public boolean isResetEmailVerified()
      Returns:
      true means that UserModel.emailVerified flag must be reset to false in this context when email address is updated
    • isRoleForContext

      public boolean isRoleForContext(Set<String> roles)
      Check if roles configuration contains role for this context.
      Parameters:
      roles - to be inspected
      Returns:
      true if roles list contains role representing checked context
    • isAttributeSupported

      public boolean isAttributeSupported(String name)