Class KeycloakUser
- java.lang.Object
-
- org.gcube.common.keycloak.model.JsonWebToken
-
- org.gcube.common.keycloak.model.IDToken
-
- org.gcube.common.keycloak.model.AccessToken
-
- org.gcube.common.authorization.utils.user.KeycloakUser
-
- All Implemented Interfaces:
Serializable,User
public class KeycloakUser extends org.gcube.common.keycloak.model.AccessToken implements User
- Author:
- Luca Frosini (ISTI-CNR)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Booleanapplicationstatic StringCLIENT_ID_PROPERTYprotected Collection<String>roles-
Fields inherited from class org.gcube.common.keycloak.model.AccessToken
allowedOrigins, realmAccess, resourceAccess, scope, trustedCertificates
-
Fields inherited from class org.gcube.common.keycloak.model.IDToken
accessTokenHash, acr, ACR, address, ADDRESS, AT_HASH, auth_time, AUTH_TIME, birthdate, BIRTHDATE, C_HASH, CLAIMS_LOCALES, claimsLocales, codeHash, email, EMAIL, EMAIL_VERIFIED, emailVerified, FAMILY_NAME, familyName, gender, GENDER, GIVEN_NAME, givenName, locale, LOCALE, MIDDLE_NAME, middleName, name, NAME, nickName, NICKNAME, nonce, NONCE, PHONE_NUMBER, PHONE_NUMBER_VERIFIED, phoneNumber, phoneNumberVerified, picture, PICTURE, PREFERRED_USERNAME, preferredUsername, profile, PROFILE, S_HASH, SESSION_STATE, sessionState, stateHash, UPDATED_AT, updatedAt, website, WEBSITE, zoneinfo, ZONEINFO
-
-
Constructor Summary
Constructors Constructor Description KeycloakUser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAbout()StringgetFullName()StringgetFullName(boolean nameSurname)Collection<String>getRoles()StringgetUsername()booleanisApplication()voidsetRoles(Collection<String> roles)-
Methods inherited from class org.gcube.common.keycloak.model.AccessToken
addAccess, getAllowedOrigins, getRealmAccess, getResourceAccess, getTrustedCertificates, id, issuer, setAllowedOrigins, setRealmAccess, setResourceAccess, setTrustedCertificates, subject, type
-
Methods inherited from class org.gcube.common.keycloak.model.IDToken
getAccessTokenHash, getAcr, getAddress, getAuth_time, getBirthdate, getClaimsLocales, getCodeHash, getEmail, getEmailVerified, getFamilyName, getGender, getGivenName, getLocale, getMiddleName, getName, getNickName, getNonce, getPhoneNumber, getPhoneNumberVerified, getPicture, getPreferredUsername, getProfile, getSessionState, getStateHash, getUpdatedAt, getWebsite, getZoneinfo, setAccessTokenHash, setAcr, setAddress, setAuth_time, setBirthdate, setClaimsLocales, setCodeHash, setEmail, setEmailVerified, setFamilyName, setGender, setGivenName, setLocale, setMiddleName, setName, setNickName, setNonce, setPhoneNumber, setPhoneNumberVerified, setPicture, setPreferredUsername, setProfile, setSessionState, setStateHash, setUpdatedAt, setWebsite, setZoneinfo
-
Methods inherited from class org.gcube.common.keycloak.model.JsonWebToken
addAudience, audience, exp, getAudience, getExp, getIat, getId, getIssuedFor, getIssuer, getNbf, getOtherClaims, getSubject, getType, hasAudience, iat, isActive, isActive, isExpired, isNotBefore, issuedFor, issuedNow, nbf, setOtherClaims, setSubject
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.gcube.common.authorization.utils.user.User
getEmail, getFamilyName, getGivenName
-
-
-
-
Field Detail
-
CLIENT_ID_PROPERTY
public static final String CLIENT_ID_PROPERTY
- See Also:
- Constant Field Values
-
roles
protected Collection<String> roles
-
application
protected Boolean application
-
-
Method Detail
-
getUsername
public String getUsername()
- Specified by:
getUsernamein interfaceUser
-
isApplication
public boolean isApplication()
- Specified by:
isApplicationin interfaceUser
-
getRoles
public Collection<String> getRoles()
-
setRoles
public void setRoles(Collection<String> roles)
-
getFullName
public String getFullName()
- Specified by:
getFullNamein interfaceUser- Returns:
- the full name in the form 'Surname Name' for a person or the application identifier for an application;
-
getFullName
public String getFullName(boolean nameSurname)
- Specified by:
getFullNamein interfaceUser- Parameters:
nameSurname- when true the fullname will be formatted as 'Name Surname', when false the fullname will be formatted as 'Surname Name',- Returns:
- the full name according to nameSurname boolean for a person or the application identifier for an application;
-
-