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
ConstructorDescriptionAppianUserDetails
(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 TypeMethodDescriptionvoid
Clear cached saml assertion once we are done consuming it.boolean
Returnstrue
if the given object is an instance ofAppianUserDetails
and has the sameusername
as this object.com.appiancorp.security.auth.AppianLoginContext
Returns 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 sourceGroupRef
s 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.UserRef
Returns the Appian data sourceUserRef
for the user of these Credentials.void
hashAndSetScsKey
(char[] scsKeyPlainText) Hashes and sets the key used to encrypt and decrypt values stored in the secure credentials store for this user.int
hashCode()
Returns the hash code of theusername
.boolean
Returns true.boolean
Returns true.boolean
boolean
Returns boolean allowOverrideForDisabledLocaleboolean
boolean
Returns true.boolean
Returns true.boolean
boolean
boolean
void
setAllowOverrideForDisabledLocale
(boolean allowOverrideForDisabledLocale) Sets allowOverrideForDisabledLocale to decide locale override when it's disabledvoid
setAppianLoginContext
(com.appiancorp.security.auth.AppianLoginContext appianLoginContext) This is meant to be set only by the internal Appian authentication provider.void
setAuthenticatedByAppianInternalProvider
(boolean value) This is meant to be set only by the internal Appian authentication provider.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.void
setCustomContext
(Class cls, String key, Object obj) Deprecated.this method should not be called by anybody other than the Appian platform.void
setEncryptedSamlAssertion
(String encryptedAssertion) This is meant to be set only by the SamlAuthenticationWrapper.void
setIsAdsSuperUser
(boolean isAdsSuperUser) void
setLoggedInThroughSaml
(boolean loggedInThroughSaml) This is meant to be set only by the internal Appian authentication provider.void
setOverrideLocale
(Locale overrideLocale) void
setPasswordStatus
(PasswordStatus passwordStatus) void
setScsKey
(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:
getUserUuid
in interfacecom.appiancorp.security.auth.SecurityContext
-
setOverrideLocale
-
getOverrideLocale
- Specified by:
getOverrideLocale
in 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:
isAllowOverrideForDisabledLocale
in interfacecom.appiancorp.security.auth.SecurityContext
-
setIsAdsSuperUser
public void setIsAdsSuperUser(boolean isAdsSuperUser) -
isAdsSuperUser
public boolean isAdsSuperUser()- Specified by:
isAdsSuperUser
in 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:
getUsername
in interfaceorg.springframework.security.core.userdetails.UserDetails
-
getPassword
- Specified by:
getPassword
in interfaceorg.springframework.security.core.userdetails.UserDetails
-
isAccountNonExpired
public boolean isAccountNonExpired()Returns true.- Specified by:
isAccountNonExpired
in interfaceorg.springframework.security.core.userdetails.UserDetails
-
isAccountNonLocked
public boolean isAccountNonLocked()Returns true.- Specified by:
isAccountNonLocked
in interfaceorg.springframework.security.core.userdetails.UserDetails
-
isCredentialsNonExpired
public boolean isCredentialsNonExpired()Returns true.- Specified by:
isCredentialsNonExpired
in interfaceorg.springframework.security.core.userdetails.UserDetails
-
isEnabled
public boolean isEnabled()Returns true.- Specified by:
isEnabled
in interfaceorg.springframework.security.core.userdetails.UserDetails
-
getAuthorities
Returns this user's roles.- Specified by:
getAuthorities
in 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 sourceUserRef
for the user of these Credentials.- Specified by:
getUserRef
in interfacecom.appiancorp.security.auth.SecurityContext
-
isUserRefNull
public boolean isUserRefNull()- Specified by:
isUserRefNull
in interfacecom.appiancorp.security.auth.SecurityContext
-
getMemberGroupUuids
Returns the UUIDs of the groups where the user is a member.- Specified by:
getMemberGroupUuids
in interfacecom.appiancorp.security.auth.SecurityContext
-
getMemberGroupRefs
Returns the Appian data sourceGroupRef
s for the groups where the user is a member.- Specified by:
getMemberGroupRefs
in interfacecom.appiancorp.security.auth.SecurityContext
-
getRoles
Returns the user's roles.- Specified by:
getRoles
in interfacecom.appiancorp.security.auth.SecurityContext
-
isSysAdmin
public boolean isSysAdmin()- Specified by:
isSysAdmin
in interfacecom.appiancorp.security.auth.SecurityContext
-
getGrantorName
- Specified by:
getGrantorName
in interfacecom.appiancorp.security.auth.SecurityContext
-
getGrantorRoles
- Specified by:
getGrantorRoles
in interfacecom.appiancorp.security.auth.SecurityContext
-
isAuthenticatedByAppianInternalProvider
public boolean isAuthenticatedByAppianInternalProvider()- Specified by:
isAuthenticatedByAppianInternalProvider
in 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:
isLoggedInThroughSaml
in 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:
getAppianLoginContext
in 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
Returnstrue
if the given object is an instance ofAppianUserDetails
and has the sameusername
as 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
.