public class UserPrincipalImpl extends java.lang.Object implements UserPrincipal
| Modifier and Type | Class and Description |
|---|---|
static class |
UserPrincipalImpl.Builder
Builds and return a UserPrincipalImpl object
|
| Modifier | Constructor and Description |
|---|---|
protected |
UserPrincipalImpl(java.lang.String username,
java.lang.String email,
java.util.Set<UserRole> roles,
java.lang.String identityToken,
java.lang.String accessToken,
java.lang.String refreshToken)
Builds a new UserPrincipalImpl object
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAccessToken()
Returns the access token for the current logged user.
|
java.lang.String |
getEmail()
Returns the email
|
java.lang.String |
getIdentityToken()
Returns the identity token.
|
java.lang.String |
getName()
Returns the username
|
java.lang.String |
getRefreshToken()
Returns the refresh token.
|
java.util.Set<UserRole> |
getRoles()
Get's user roles
|
boolean |
hasClientRole(java.lang.String role,
java.lang.String clientId)
Checks if the user has the specified Client role.
|
boolean |
hasRealmRole(java.lang.String role)
Checks if the user has the specified Realm role.
|
static UserPrincipalImpl.Builder |
newUser() |
java.lang.String |
toString() |
protected UserPrincipalImpl(java.lang.String username,
java.lang.String email,
java.util.Set<UserRole> roles,
java.lang.String identityToken,
java.lang.String accessToken,
java.lang.String refreshToken)
username - the username of the authenticated useremail - the email of the authenticated userroles - roles assigned to the useridentityToken - the identity tokenaccessToken - the access tokenrefreshToken - the refresh tokenpublic boolean hasClientRole(java.lang.String role,
java.lang.String clientId)
hasClientRole in interface UserPrincipalrole - role to be checkedclientId - clientID related to roletrue or falsepublic boolean hasRealmRole(java.lang.String role)
hasRealmRole in interface UserPrincipalrole - role to be checkedtrue or falsepublic java.lang.String getName()
UserPrincipalgetName in interface UserPrincipalpublic java.util.Set<UserRole> getRoles()
getRoles in interface UserPrincipalpublic java.lang.String getEmail()
UserPrincipalgetEmail in interface UserPrincipalpublic static UserPrincipalImpl.Builder newUser()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getIdentityToken()
getIdentityToken in interface UserPrincipalpublic java.lang.String getAccessToken()
getAccessToken in interface UserPrincipalpublic java.lang.String getRefreshToken()
getRefreshToken in interface UserPrincipal