Class AuthenticatedToken
java.lang.Object
org.springframework.security.core.userdetails.User
net.solarnetwork.central.security.AuthenticatedToken
- All Implemented Interfaces:
Serializable,UserIdRelated,SecurityActor,SecurityToken,org.springframework.security.core.CredentialsContainer,org.springframework.security.core.userdetails.UserDetails
public class AuthenticatedToken
extends org.springframework.security.core.userdetails.User
implements SecurityToken
SecurityUser implementation for authenticated tokens.- 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(org.springframework.security.core.userdetails.UserDetails user, SecurityTokenType tokenType, Long userId, SecurityPolicy policy) Construct with values. -
Method Summary
Methods inherited from class org.springframework.security.core.userdetails.User
builder, equals, eraseCredentials, getAuthorities, getPassword, getUsername, hashCode, isAccountNonExpired, isAccountNonLocked, isCredentialsNonExpired, isEnabled, withDefaultPasswordEncoder, withUserDetails, withUsername
-
Constructor Details
-
AuthenticatedToken
public AuthenticatedToken(org.springframework.security.core.userdetails.UserDetails user, SecurityTokenType tokenType, Long userId, SecurityPolicy policy) Construct with values.- Parameters:
user- the user detailstokenType- the token typeuserId- the user ID (that the token belongs to)policy- optional policy associated with the token- Throws:
IllegalArgumentException- if any argument other thanpolicyis null
-
-
Method Details
-
toString
- Overrides:
toStringin classorg.springframework.security.core.userdetails.User
-
isAuthenticatedWithToken
public boolean isAuthenticatedWithToken()Description copied from interface:SecurityActorReturn true if the actor authenticated via a token.- Specified by:
isAuthenticatedWithTokenin interfaceSecurityActor- Returns:
- boolean
-
getUserId
Description copied from interface:SecurityTokenGet a unique user ID that owns the token.- Specified by:
getUserIdin interfaceSecurityToken- Specified by:
getUserIdin interfaceUserIdRelated- Returns:
- the user ID
-
getToken
Description copied from interface:SecurityTokenGet the token value.- Specified by:
getTokenin interfaceSecurityToken- Returns:
- the token
-
getTokenType
Description copied from interface:SecurityTokenGet the type of token.- Specified by:
getTokenTypein interfaceSecurityToken- Returns:
- the token type
-
getPolicy
Description copied from interface:SecurityTokenGet an optional security policy.- Specified by:
getPolicyin interfaceSecurityToken- Returns:
- optional security policy
-