Class AppianUserDetails
java.lang.Object
com.appiancorp.suiteapi.security.auth.AppianUserDetails
- All Implemented Interfaces:
com.appiancorp.security.auth.SecurityContext,com.appiancorp.suiteapi.security.auth.UserDetailsAndSecurityContext,Serializable,Principal,org.springframework.security.core.userdetails.UserDetails
public class AppianUserDetails
extends Object
implements com.appiancorp.suiteapi.security.auth.UserDetailsAndSecurityContext
Implements the Spring
UserDetails interface and holds Appian-specific data about a user.
Use AppianUserDetailsService to get an instance of this class.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAppianUserDetails(UserProfile userProfile, com.appiancorp.security.auth.GroupMembershipInfoProvider groupMembershipInfoProvider, PasswordStatus passwordStatus) AppianUserDetails(UserProfile userProfile, PasswordStatus passwordStatus, Set<String> roles) Deprecated.AppianUserDetails(String username, com.appiancorp.security.auth.GroupMembershipInfoProvider groupMembershipInfoProvider) Constructor to use when you only have the username since calling to retrieve a UserProfile object is comparatively expensive. -
Method Summary
Modifier and TypeMethodDescriptionvoidClear cached saml assertion once we are done consuming it.booleanReturnstrueif the given object is an instance ofAppianUserDetailsand has the sameusernameas this object.com.appiancorp.security.auth.AppianLoginContextReturns SSO specific login context that is used internally.Collection<org.springframework.security.core.GrantedAuthority>Returns this user's roles.getCustomContext(Class cls, String key) Deprecated.this method should not be called by anybody other than the Appian platform.Holds encrypted saml assertion used to authenticate user when they logged in via saml.Set<com.appiancorp.type.refs.GroupRef>Returns the Appian data sourceGroupRefs for the groups where the user is a member.Returns the UUIDs of the groups where the user is a member.getName()getRoles()Returns the user's roles.char[]Returns the key used to encrypt and decrypt values stored in the secure credentials store for this user.com.appiancorp.type.refs.UserRefReturns the Appian data sourceUserReffor the user of these Credentials.voidhashAndSetScsKey(char[] scsKeyPlainText) Hashes and sets the key used to encrypt and decrypt values stored in the secure credentials store for this user.inthashCode()Returns the hash code of theusername.booleanReturns true.booleanReturns true.booleanbooleanReturns boolean allowOverrideForDisabledLocalebooleanbooleanReturns true.booleanReturns true.booleanbooleanbooleanvoidsetAllowOverrideForDisabledLocale(boolean allowOverrideForDisabledLocale) Sets allowOverrideForDisabledLocale to decide locale override when it's disabledvoidsetAppianLoginContext(com.appiancorp.security.auth.AppianLoginContext appianLoginContext) This is meant to be set only by the internal Appian authentication provider.voidsetAuthenticatedByAppianInternalProvider(boolean value) This is meant to be set only by the internal Appian authentication provider.voidsetAuthorities(Collection<org.springframework.security.core.GrantedAuthority> authorities) Deprecated.The authorities are calculated from the user's group memebrship and it is no longer necessary to set authorities explicitly.voidsetCustomContext(Class cls, String key, Object obj) Deprecated.this method should not be called by anybody other than the Appian platform.voidsetEncryptedSamlAssertion(String encryptedAssertion) This is meant to be set only by the SamlAuthenticationWrapper.voidsetIsAdsSuperUser(boolean isAdsSuperUser) voidsetLoggedInThroughSaml(boolean loggedInThroughSaml) This is meant to be set only by the internal Appian authentication provider.voidsetOverrideLocale(Locale overrideLocale) voidsetPasswordStatus(PasswordStatus passwordStatus) voidsetScsKey(char[] scsKey) Sets the key used to encrypt and decrypt values stored in the secure credentials store for this user.toString()
-
Constructor Details
-
AppianUserDetails
@Deprecated public AppianUserDetails(UserProfile userProfile, PasswordStatus passwordStatus, Set<String> roles) Deprecated. -
AppianUserDetails
public AppianUserDetails(UserProfile userProfile, com.appiancorp.security.auth.GroupMembershipInfoProvider groupMembershipInfoProvider, PasswordStatus passwordStatus) -
AppianUserDetails
public AppianUserDetails(String username, com.appiancorp.security.auth.GroupMembershipInfoProvider groupMembershipInfoProvider) Constructor to use when you only have the username since calling to retrieve a UserProfile object is comparatively expensive.
-
-
Method Details
-
getUserProfile
-
getUserUuid
- Specified by:
getUserUuidin interfacecom.appiancorp.security.auth.SecurityContext
-
setOverrideLocale
-
getOverrideLocale
- Specified by:
getOverrideLocalein interfacecom.appiancorp.security.auth.SecurityContext
-
setAllowOverrideForDisabledLocale
public void setAllowOverrideForDisabledLocale(boolean allowOverrideForDisabledLocale) Sets allowOverrideForDisabledLocale to decide locale override when it's disabled -
isAllowOverrideForDisabledLocale
public boolean isAllowOverrideForDisabledLocale()Returns boolean allowOverrideForDisabledLocale- Specified by:
isAllowOverrideForDisabledLocalein interfacecom.appiancorp.security.auth.SecurityContext
-
setIsAdsSuperUser
public void setIsAdsSuperUser(boolean isAdsSuperUser) -
isAdsSuperUser
public boolean isAdsSuperUser()- Specified by:
isAdsSuperUserin interfacecom.appiancorp.security.auth.SecurityContext
-
getPasswordStatus
-
setPasswordStatus
-
getScsKey
public char[] getScsKey()Returns the key used to encrypt and decrypt values stored in the secure credentials store for this user. This key is used by the system automatically and should not be used for any other purposes.- Returns:
- the key
-
setScsKey
public void setScsKey(char[] scsKey) Sets the key used to encrypt and decrypt values stored in the secure credentials store for this user. This key is set by the system automatically.- Parameters:
scsKey- the key that will be used to encrypt and decrypt values
-
hashAndSetScsKey
public void hashAndSetScsKey(char[] scsKeyPlainText) Hashes and sets the key used to encrypt and decrypt values stored in the secure credentials store for this user. This key is set by the system automatically.- Parameters:
scsKeyPlainText- the plain text of the key that will be used to encrypt and decrypt values
-
getUsername
- Specified by:
getUsernamein interfaceorg.springframework.security.core.userdetails.UserDetails
-
getPassword
- Specified by:
getPasswordin interfaceorg.springframework.security.core.userdetails.UserDetails
-
isAccountNonExpired
public boolean isAccountNonExpired()Returns true.- Specified by:
isAccountNonExpiredin interfaceorg.springframework.security.core.userdetails.UserDetails
-
isAccountNonLocked
public boolean isAccountNonLocked()Returns true.- Specified by:
isAccountNonLockedin interfaceorg.springframework.security.core.userdetails.UserDetails
-
isCredentialsNonExpired
public boolean isCredentialsNonExpired()Returns true.- Specified by:
isCredentialsNonExpiredin interfaceorg.springframework.security.core.userdetails.UserDetails
-
isEnabled
public boolean isEnabled()Returns true.- Specified by:
isEnabledin interfaceorg.springframework.security.core.userdetails.UserDetails
-
getAuthorities
Returns this user's roles.- Specified by:
getAuthoritiesin interfaceorg.springframework.security.core.userdetails.UserDetails
-
setAuthorities
@Deprecated public void setAuthorities(Collection<org.springframework.security.core.GrantedAuthority> authorities) Deprecated.The authorities are calculated from the user's group memebrship and it is no longer necessary to set authorities explicitly.- Parameters:
authorities-
-
getName
-
getUserRef
public com.appiancorp.type.refs.UserRef getUserRef()Returns the Appian data sourceUserReffor the user of these Credentials.- Specified by:
getUserRefin interfacecom.appiancorp.security.auth.SecurityContext
-
isUserRefNull
public boolean isUserRefNull()- Specified by:
isUserRefNullin interfacecom.appiancorp.security.auth.SecurityContext
-
getMemberGroupUuids
Returns the UUIDs of the groups where the user is a member.- Specified by:
getMemberGroupUuidsin interfacecom.appiancorp.security.auth.SecurityContext
-
getMemberGroupRefs
Returns the Appian data sourceGroupRefs for the groups where the user is a member.- Specified by:
getMemberGroupRefsin interfacecom.appiancorp.security.auth.SecurityContext
-
getRoles
Returns the user's roles.- Specified by:
getRolesin interfacecom.appiancorp.security.auth.SecurityContext
-
isSysAdmin
public boolean isSysAdmin()- Specified by:
isSysAdminin interfacecom.appiancorp.security.auth.SecurityContext
-
getGrantorName
- Specified by:
getGrantorNamein interfacecom.appiancorp.security.auth.SecurityContext
-
getGrantorRoles
- Specified by:
getGrantorRolesin interfacecom.appiancorp.security.auth.SecurityContext
-
isAuthenticatedByAppianInternalProvider
public boolean isAuthenticatedByAppianInternalProvider()- Specified by:
isAuthenticatedByAppianInternalProviderin interfacecom.appiancorp.security.auth.SecurityContext- Returns:
- true if Appian's internal authentication provider authenticated the user. If multiple authentication providers are chained, this will return true if Appian's internal provider was reached and successfully authenticated the user, regardless of the response of other providers.
-
setAuthenticatedByAppianInternalProvider
public void setAuthenticatedByAppianInternalProvider(boolean value) This is meant to be set only by the internal Appian authentication provider. -
isLoggedInThroughSaml
public boolean isLoggedInThroughSaml()- Specified by:
isLoggedInThroughSamlin interfacecom.appiancorp.security.auth.SecurityContext- Returns:
- true if Appian's internal SAML authentication provider authenticated the user. If multiple authentication providers are chained, this will return true if Appian's internal provider was reached and successfully authenticated the user, regardless of the response of other providers.
-
setLoggedInThroughSaml
public void setLoggedInThroughSaml(boolean loggedInThroughSaml) This is meant to be set only by the internal Appian authentication provider. -
getAppianLoginContext
public com.appiancorp.security.auth.AppianLoginContext getAppianLoginContext()Returns SSO specific login context that is used internally.- Specified by:
getAppianLoginContextin interfacecom.appiancorp.security.auth.SecurityContext
-
setAppianLoginContext
public void setAppianLoginContext(com.appiancorp.security.auth.AppianLoginContext appianLoginContext) This is meant to be set only by the internal Appian authentication provider. -
getEncryptedSamlAssertion
Holds encrypted saml assertion used to authenticate user when they logged in via saml. It is empty by default and will be cleared by OAuthSamlAuthGrantLoginSuccessListener once it has been consumed.- Returns:
- encrypted saml assertion or empty string if not set
-
setEncryptedSamlAssertion
This is meant to be set only by the SamlAuthenticationWrapper. Used by OAuth Saml based Auth type Http Connected Systems. If null input is provided it will normalized to an empty string.- Parameters:
encryptedAssertion-
-
clearEncryptedSamlAssertion
public void clearEncryptedSamlAssertion()Clear cached saml assertion once we are done consuming it. We should not hold on it for longer than required period. -
toString
-
hashCode
public int hashCode()Returns the hash code of theusername. -
equals
Returnstrueif the given object is an instance ofAppianUserDetailsand has the sameusernameas this object. -
setCustomContext
Deprecated.this method should not be called by anybody other than the Appian platform. The behavior of this method is undocumented, and it may be removed or changed in future releases. -
getCustomContext
Deprecated.this method should not be called by anybody other than the Appian platform. The behavior of this method is undocumented, and it may be removed or changed in future releases.
-
AppianUserDetailsService.