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
IdentityProvider
after a successful authentication.- Author:
- Pedro Igor
-
-
Constructor Summary
Constructors Constructor Description BrokeredIdentityContext(String id)
-
Method Summary
-
-
-
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:
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.usesetFirstName(String)
andsetLastName(String)
instead- Parameters:
name
-
-
-