Class BrokeredIdentityContext

java.lang.Object
org.keycloak.broker.provider.BrokeredIdentityContext

public class BrokeredIdentityContext extends Object

Represents all identity information obtained from an IdentityProvider after a successful authentication.

Author:
Pedro Igor
  • Constructor Details

    • BrokeredIdentityContext

      public BrokeredIdentityContext(String id)
  • Method Details

    • getId

      public String getId()
    • setId

      public void setId(String id)
    • getLegacyId

      public String getLegacyId()
      ID from older API version. For API migrations.
      Returns:
      legacy ID
    • setLegacyId

      public void setLegacyId(String legacyId)
    • getUsername

      public String getUsername()
      Username in remote idp
      Returns:
    • setUsername

      public void setUsername(String username)
    • getModelUsername

      public String getModelUsername()
      username to store in UserModel
      Returns:
    • setModelUsername

      public void setModelUsername(String modelUsername)
    • getEmail

      public String getEmail()
    • setEmail

      public void setEmail(String email)
    • getBrokerSessionId

      public String getBrokerSessionId()
    • setBrokerSessionId

      public void setBrokerSessionId(String brokerSessionId)
    • getBrokerUserId

      public String getBrokerUserId()
    • setBrokerUserId

      public void setBrokerUserId(String brokerUserId)
    • getToken

      public String getToken()
    • setToken

      public void setToken(String token)
    • getIdpConfig

      public IdentityProviderModel getIdpConfig()
    • setIdpConfig

      public void setIdpConfig(IdentityProviderModel idpConfig)
    • getIdp

      public IdentityProvider getIdp()
    • setIdp

      public void setIdp(IdentityProvider idp)
    • getContextData

      public Map<String,Object> getContextData()
    • setContextData

      public void setContextData(Map<String,Object> contextData)
    • setSessionNote

      public void setSessionNote(String key, String value)
    • addSessionNotesToUserSession

      public void addSessionNotesToUserSession(UserSessionModel userSession)
    • setUserAttribute

      public void setUserAttribute(String attributeName, String attributeValue)
    • removeUserAttribute

      public void removeUserAttribute(String attributeName)
    • setUserAttribute

      public void setUserAttribute(String attributeName, List<String> attributeValues)
    • getUserAttribute

      public String getUserAttribute(String attributeName)
    • getAttributes

      public Map<String,List<String>> getAttributes()
    • getFirstName

      public String getFirstName()
    • setFirstName

      public void setFirstName(String firstName)
    • getLastName

      public String getLastName()
    • setLastName

      public void setLastName(String lastName)
    • getAuthenticationSession

      public AuthenticationSessionModel getAuthenticationSession()
    • setAuthenticationSession

      public void setAuthenticationSession(AuthenticationSessionModel authenticationSession)
    • hasMapperGrantedRole

      public boolean hasMapperGrantedRole(String roleName)
      Verifies if a mapper has already granted the specified role.
      Parameters:
      roleName - the name of the role.
      Returns:
      true if a mapper has already granted the role; false otherwise.
    • hasMapperAssignedGroup

      public boolean hasMapperAssignedGroup(String groupId)
      Verifies if a mapper has already assigned the specified group.
      Parameters:
      groupId - the id of the group.
      Returns:
      true if a mapper has already assigned the group; false otherwise.
    • addMapperGrantedRole

      public void addMapperGrantedRole(String roleName)
      Adds the specified role to the set of roles granted by mappers.
      Parameters:
      roleName - the name of the role.
    • addMapperAssignedGroup

      public void addMapperAssignedGroup(String groupId)
      Adds the specified group to the set of groups assigned by mappers.
      Parameters:
      groupId - the id of the group.
    • setName

      @Deprecated public void setName(String name)
      Deprecated.
      Parameters:
      name -
    • toString

      public String toString()
      Overrides:
      toString in class Object