Class CompositeTokenProvider
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.security.authentication.token.CompositeTokenProvider
-
- All Implemented Interfaces:
TokenProvider
public final class CompositeTokenProvider extends java.lang.Object implements TokenProvider
Aggregates a collection ofTokenProvider
s into a single provider.
-
-
Field Summary
-
Fields inherited from interface org.apache.jackrabbit.oak.spi.security.authentication.token.TokenProvider
PARAM_TOKEN_EXPIRATION, PARAM_TOKEN_LENGTH, PARAM_TOKEN_REFRESH
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable TokenInfo
createToken(@NotNull java.lang.String userId, @NotNull java.util.Map<java.lang.String,?> attributes)
Issues a new login token for the user with the givenuserId
and the specified attributes.@Nullable TokenInfo
createToken(@NotNull Credentials credentials)
Issues a new login token for the user with the specified credentials and returns the associatedTokenInfo
.boolean
doCreateToken(@NotNull Credentials credentials)
Returnstrue
if the given credentials indicate that a new token needs to be issued.@Nullable TokenInfo
getTokenInfo(@NotNull java.lang.String token)
Retrieves theTokenInfo
associated with the specified login token ornull
.static @NotNull TokenProvider
newInstance(@NotNull java.util.List<? extends TokenProvider> providers)
static @NotNull TokenProvider
newInstance(@NotNull TokenProvider... providers)
-
-
-
Method Detail
-
newInstance
@NotNull public static @NotNull TokenProvider newInstance(@NotNull @NotNull TokenProvider... providers)
-
newInstance
@NotNull public static @NotNull TokenProvider newInstance(@NotNull @NotNull java.util.List<? extends TokenProvider> providers)
-
doCreateToken
public boolean doCreateToken(@NotNull @NotNull Credentials credentials)
Description copied from interface:TokenProvider
Returnstrue
if the given credentials indicate that a new token needs to be issued.- Specified by:
doCreateToken
in interfaceTokenProvider
- Parameters:
credentials
- The current credentials.- Returns:
true
if a new login token needs to be created,false
otherwise.
-
createToken
@Nullable public @Nullable TokenInfo createToken(@NotNull @NotNull Credentials credentials)
Description copied from interface:TokenProvider
Issues a new login token for the user with the specified credentials and returns the associatedTokenInfo
.- Specified by:
createToken
in interfaceTokenProvider
- Parameters:
credentials
- The current credentials.- Returns:
- The
TokenInfo
associated with the new login token ornull
if no token has been created.
-
createToken
@Nullable public @Nullable TokenInfo createToken(@NotNull @NotNull java.lang.String userId, @NotNull @NotNull java.util.Map<java.lang.String,?> attributes)
Description copied from interface:TokenProvider
Issues a new login token for the user with the givenuserId
and the specified attributes.- Specified by:
createToken
in interfaceTokenProvider
- Parameters:
userId
- The identifier of the user for which a new token should be created.attributes
- The attributes associated with the new token.- Returns:
- The
TokenInfo
associated with the new login token ornull
if no token has been created.
-
getTokenInfo
@Nullable public @Nullable TokenInfo getTokenInfo(@NotNull @NotNull java.lang.String token)
Description copied from interface:TokenProvider
Retrieves theTokenInfo
associated with the specified login token ornull
.- Specified by:
getTokenInfo
in interfaceTokenProvider
- Parameters:
token
- A valid login token.- Returns:
- the
TokenInfo
associated with the specified login token ornull
.
-
-