Class UserAuthentication

java.lang.Object
com.erudika.para.server.security.UserAuthentication
All Implemented Interfaces:
Serializable, Principal, org.springframework.security.core.Authentication
Direct Known Subclasses:
JWTAuthentication

public class UserAuthentication extends Object implements org.springframework.security.core.Authentication
A simple wrapper for the authentication object.
Author:
Alex Bogdanovski [[email protected]]
See Also:
  • Constructor Details

    • UserAuthentication

      public UserAuthentication(AuthenticatedUserDetails principal)
      Default constructor.
      Parameters:
      principal - the user object
  • Method Details

    • getAuthorities

      public Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
      A list of roles for the authenticated user.
      Specified by:
      getAuthorities in interface org.springframework.security.core.Authentication
      Returns:
      a list of roles
    • getCredentials

      public Object getCredentials()
      Always null (unused).
      Specified by:
      getCredentials in interface org.springframework.security.core.Authentication
      Returns:
      credentials string
    • getDetails

      public Object getDetails()
      The user details object.
      Specified by:
      getDetails in interface org.springframework.security.core.Authentication
      Returns:
      the user
    • getPrincipal

      public Object getPrincipal()
      The user details object.
      Specified by:
      getPrincipal in interface org.springframework.security.core.Authentication
      Returns:
      the user
    • isAuthenticated

      public boolean isAuthenticated()
      Checks if the user is authenticated.
      Specified by:
      isAuthenticated in interface org.springframework.security.core.Authentication
      Returns:
      true if authenticated
    • setAuthenticated

      public void setAuthenticated(boolean isAuthenticated)
      Not supported.
      Specified by:
      setAuthenticated in interface org.springframework.security.core.Authentication
      Parameters:
      isAuthenticated - true if authenticated
    • getName

      public String getName()
      The user identifier.
      Specified by:
      getName in interface Principal
      Returns:
      the identifier