Package org.keycloak.broker.provider
Class BrokeredIdentityContext
- java.lang.Object
-
- org.keycloak.broker.provider.BrokeredIdentityContext
-
public class BrokeredIdentityContext extends Object
Represents all identity information obtained from an
IdentityProviderafter a successful authentication.- Author:
- Pedro Igor
-
-
Constructor Summary
Constructors Constructor Description BrokeredIdentityContext(String id)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddMapperAssignedGroup(String groupId)Adds the specified group to the set of groups assigned by mappers.voidaddMapperGrantedRole(String roleName)Adds the specified role to the set of roles granted by mappers.AuthenticationSessionModelgetAuthenticationSession()StringgetBrokerSessionId()StringgetBrokerUserId()Map<String,Object>getContextData()StringgetEmail()StringgetFirstName()StringgetId()IdentityProvidergetIdp()IdentityProviderModelgetIdpConfig()StringgetLastName()StringgetLegacyId()ID from older API version.StringgetModelUsername()username to store in UserModelStringgetToken()StringgetUserAttribute(String attributeName)StringgetUsername()Username in remote idpbooleanhasMapperAssignedGroup(String groupId)Verifies if a mapper has already assigned the specified group.booleanhasMapperGrantedRole(String roleName)Verifies if a mapper has already granted the specified role.voidremoveUserAttribute(String attributeName)voidsetAuthenticationSession(AuthenticationSessionModel authenticationSession)voidsetBrokerSessionId(String brokerSessionId)voidsetBrokerUserId(String brokerUserId)voidsetContextData(Map<String,Object> contextData)voidsetEmail(String email)voidsetFirstName(String firstName)voidsetId(String id)voidsetIdp(IdentityProvider idp)voidsetIdpConfig(IdentityProviderModel idpConfig)voidsetLastName(String lastName)voidsetLegacyId(String legacyId)voidsetModelUsername(String modelUsername)voidsetName(String name)Deprecated.usesetFirstName(String)andsetLastName(String)insteadvoidsetToken(String token)voidsetUserAttribute(String attributeName, String attributeValue)voidsetUserAttribute(String attributeName, List<String> attributeValues)voidsetUsername(String username)StringtoString()
-
-
-
Constructor Detail
-
BrokeredIdentityContext
public BrokeredIdentityContext(String id)
-
-
Method Detail
-
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)
-
removeUserAttribute
public void removeUserAttribute(String attributeName)
-
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:
trueif a mapper has already granted the role;falseotherwise.
-
hasMapperAssignedGroup
public boolean hasMapperAssignedGroup(String groupId)
Verifies if a mapper has already assigned the specified group.- Parameters:
groupId- the id of the group.- Returns:
trueif a mapper has already assigned the group;falseotherwise.
-
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.usesetFirstName(String)andsetLastName(String)instead- Parameters:
name-
-
-