Class PlatformUserDetails

java.lang.Object
org.odpi.openmetadata.userauthn.auth.PlatformUserDetails
All Implemented Interfaces:
Serializable, org.springframework.security.core.userdetails.UserDetails

public class PlatformUserDetails extends Object implements org.springframework.security.core.userdetails.UserDetails
PlatformUserDetails is a wrapper for OpenMetadataSecurityUserDetails which is supported by the open metadata security module. The wrapper is used to avoid including Spring classes in the Open Metadata security module
See Also:
  • Constructor Details

    • PlatformUserDetails

      public PlatformUserDetails(OpenMetadataUserAccount openMetadataUserAccount)
      Copy constructor
  • Method Details

    • isAccountNonExpired

      public boolean isAccountNonExpired()
      Return if the account is not disabled.
      Specified by:
      isAccountNonExpired in interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      boolean
    • isAccountNonLocked

      public boolean isAccountNonLocked()
      Return if the account is not locked.
      Specified by:
      isAccountNonLocked in interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      boolean
    • isCredentialsNonExpired

      public boolean isCredentialsNonExpired()
      Return whether the account credentials (secrets) are still valid.
      Specified by:
      isCredentialsNonExpired in interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      boolean
    • isEnabled

      public boolean isEnabled()
      Return whether the account is enabled.
      Specified by:
      isEnabled in interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      boolean
    • getAuthorities

      public Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
      Extracts the user identifier, security roles and security groups from the user account and sets them up as authorities for the token. This is called once the password has been validated.
      Specified by:
      getAuthorities in interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      collection of granted authorities
    • getPassword

      public String getPassword()
      Return an encrypted password. It may be possible to retrieve the encrypted password from the user account. If that is not available, it retrieves the clear text password and encrypts it.
      Specified by:
      getPassword in interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      encrypted password
    • getUsername

      public String getUsername()
      Return the userId of the user's account. Notice capitalization of Username.
      Specified by:
      getUsername in interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      string userId
    • getDisplayName

      public String getDisplayName()
      Return the name of the user.
      Returns:
      string name
    • getDistinguishedName

      public String getDistinguishedName()
      Return the distinguished name of the user.
      Returns:
      string name
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object objectToCompare)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object