Class 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
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.gcube.common.keycloak.model.AccessToken

        org.gcube.common.keycloak.model.AccessToken.Access
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Boolean application  
      static String CLIENT_ID_PROPERTY  
      static String CLIENT_ID_PROPERTY_OLD_KEY  
      protected 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
      • Fields inherited from class org.gcube.common.keycloak.model.JsonWebToken

        audience, exp, iat, id, issuedFor, issuer, nbf, otherClaims, subject, type
    • Constructor Summary

      Constructors 
      Constructor Description
      KeycloakUser()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      String getAbout()  
      protected String getClientId()  
      String getFullName()  
      String getFullName​(boolean nameSurname)  
      Collection<String> getRoles()  
      String getUsername()  
      boolean isApplication()  
      void setRoles​(Collection<String> roles)  
      • Methods inherited from class org.gcube.common.keycloak.model.AccessToken

        addAccess, getAllowedOrigins, getRealmAccess, getResourceAccess, getScope, getTrustedCertificates, id, issuer, setAllowedOrigins, setRealmAccess, setResourceAccess, setScope, 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
    • Constructor Detail

      • KeycloakUser

        public KeycloakUser()
    • Method Detail

      • getClientId

        protected String getClientId()
      • isApplication

        public boolean isApplication()
        Specified by:
        isApplication in interface User
      • getFullName

        public String getFullName()
        Specified by:
        getFullName in interface User
        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:
        getFullName in interface User
        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;