Package net.solarnetwork.node.domain
Class AuthenticatedToken
java.lang.Object
org.springframework.security.core.userdetails.User
net.solarnetwork.node.domain.AuthenticatedToken
- All Implemented Interfaces:
Serializable,SecurityActor,org.springframework.security.core.CredentialsContainer,org.springframework.security.core.userdetails.UserDetails
public class AuthenticatedToken
extends org.springframework.security.core.userdetails.User
implements SecurityActor
SecurityActor implementation for authenticated tokens.- Since:
- 3.4
- Version:
- 1.0
- Author:
- matt
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.security.core.userdetails.User
org.springframework.security.core.userdetails.User.UserBuilder -
Constructor Summary
ConstructorsConstructorDescriptionAuthenticatedToken(SecurityToken token, String... roles) Construct with values.AuthenticatedToken(SecurityToken token, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities) Construct with values. -
Method Summary
Modifier and TypeMethodDescriptionGet the token.booleanReturntrueif the actor authenticated via a token.Methods inherited from class org.springframework.security.core.userdetails.User
builder, equals, eraseCredentials, getAuthorities, getPassword, getUsername, hashCode, isAccountNonExpired, isAccountNonLocked, isCredentialsNonExpired, isEnabled, toString, withDefaultPasswordEncoder, withUserDetails, withUsername
-
Constructor Details
-
AuthenticatedToken
Construct with values.- Parameters:
token- the tokenroles- the granted roles- Throws:
IllegalArgumentException- if any argument is null or empty
-
AuthenticatedToken
public AuthenticatedToken(SecurityToken token, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities) Construct with values.- Parameters:
token- the tokenauthorities- the granted authorities- Throws:
IllegalArgumentException- if any argument is null
-
-
Method Details
-
isAuthenticatedWithToken
public boolean isAuthenticatedWithToken()Description copied from interface:SecurityActorReturntrueif the actor authenticated via a token.- Specified by:
isAuthenticatedWithTokenin interfaceSecurityActor- Returns:
- boolean
-
getSecurityToken
Description copied from interface:SecurityActorGet the token.- Specified by:
getSecurityTokenin interfaceSecurityActor- Returns:
- the token, or null if not authenticated with a token
-