Interface Authentication
- All Superinterfaces:
Principal
,Serializable
- All Known Implementing Classes:
AuthenticationJWTClaimsSetAdapter
,ClientAuthentication
,ServerAuthentication
,X509Authentication
Represents the state of an authentication.
- Since:
- 1.0
- Author:
- James Kleeh
-
Method Summary
Modifier and TypeMethodDescriptionstatic Authentication
Builds anAuthentication
instance for the user.static Authentication
build
(String username, Collection<String> roles) Builds anAuthentication
instance for the user.static Authentication
Builds anAuthentication
instance for the user.static Authentication
Builds anAuthentication
instance for the user.In order to correctly implement theSerializable
specification, this map should be Map<String, Serializable>, however that would place a burden on those not requiring serialization, forcing their values to conform to that spec.default Collection<String>
getRoles()
-
Method Details
-
getAttributes
In order to correctly implement theSerializable
specification, this map should be Map<String, Serializable>, however that would place a burden on those not requiring serialization, forcing their values to conform to that spec. This is left intentionally as Object in order to meet both use cases and those requiring serialization must ensure all values in the map implementSerializable
.- Returns:
- Any additional attributes in the authentication
-
getRoles
- Returns:
- Any roles associated with the authentication
-
build
Builds anAuthentication
instance for the user.- Parameters:
username
- User's name- Returns:
- An
Authentication
for the User
-
build
Builds anAuthentication
instance for the user.- Parameters:
username
- User's nameroles
- User's roles- Returns:
- An
Authentication
for the User
-
build
@NonNull static Authentication build(@NonNull String username, @NonNull Map<String, Object> attributes) Builds anAuthentication
instance for the user.- Parameters:
username
- User's nameattributes
- User's attributes- Returns:
- An
Authentication
for the User
-
build
@NonNull static Authentication build(@NonNull String username, @Nullable Collection<String> roles, @Nullable Map<String, Object> attributes) Builds anAuthentication
instance for the user.- Parameters:
username
- User's nameroles
- User's rolesattributes
- User's attributes- Returns:
- An
Authentication
for the User
-