Package com.erudika.para.server.security
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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.security.core.Authentication
org.springframework.security.core.Authentication.Builder<B extends org.springframework.security.core.Authentication.Builder<B>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCollection<? extends org.springframework.security.core.GrantedAuthority> A list of roles for the authenticated user.Always null (unused).The user details object.getName()The user identifier.The user details object.booleanChecks if the user is authenticated.voidsetAuthenticated(boolean isAuthenticated) Not supported.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.security.core.Authentication
toBuilder
-
Constructor Details
-
UserAuthentication
Default constructor.- Parameters:
principal- the user object
-
-
Method Details
-
getAuthorities
A list of roles for the authenticated user.- Specified by:
getAuthoritiesin interfaceorg.springframework.security.core.Authentication- Returns:
- a list of roles
-
getCredentials
Always null (unused).- Specified by:
getCredentialsin interfaceorg.springframework.security.core.Authentication- Returns:
- credentials string
-
getDetails
The user details object.- Specified by:
getDetailsin interfaceorg.springframework.security.core.Authentication- Returns:
- the user
-
getPrincipal
The user details object.- Specified by:
getPrincipalin interfaceorg.springframework.security.core.Authentication- Returns:
- the user
-
isAuthenticated
public boolean isAuthenticated()Checks if the user is authenticated.- Specified by:
isAuthenticatedin interfaceorg.springframework.security.core.Authentication- Returns:
- true if authenticated
-
setAuthenticated
public void setAuthenticated(boolean isAuthenticated) Not supported.- Specified by:
setAuthenticatedin interfaceorg.springframework.security.core.Authentication- Parameters:
isAuthenticated- true if authenticated
-
getName
The user identifier.
-