Class CompositeTokenProvider
java.lang.Object
org.apache.jackrabbit.oak.spi.security.authentication.token.CompositeTokenProvider
- All Implemented Interfaces:
TokenProvider
Aggregates a collection of
TokenProviders 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
Modifier and TypeMethodDescription@Nullable TokenInfocreateToken(@NotNull String userId, @NotNull Map<String, ?> attributes) Issues a new login token for the user with the givenuserIdand the specified attributes.@Nullable TokenInfocreateToken(@NotNull Credentials credentials) Issues a new login token for the user with the specified credentials and returns the associatedTokenInfo.booleandoCreateToken(@NotNull Credentials credentials) Returnstrueif the given credentials indicate that a new token needs to be issued.@Nullable TokenInfogetTokenInfo(@NotNull String token) Retrieves theTokenInfoassociated with the specified login token ornull.static @NotNull TokenProvidernewInstance(@NotNull List<? extends TokenProvider> providers) static @NotNull TokenProvidernewInstance(@NotNull TokenProvider... providers)
-
Method Details
-
newInstance
@NotNull public static @NotNull TokenProvider newInstance(@NotNull @NotNull TokenProvider... providers) -
newInstance
@NotNull public static @NotNull TokenProvider newInstance(@NotNull @NotNull List<? extends TokenProvider> providers) -
doCreateToken
Description copied from interface:TokenProviderReturnstrueif the given credentials indicate that a new token needs to be issued.- Specified by:
doCreateTokenin interfaceTokenProvider- Parameters:
credentials- The current credentials.- Returns:
trueif a new login token needs to be created,falseotherwise.
-
createToken
Description copied from interface:TokenProviderIssues a new login token for the user with the specified credentials and returns the associatedTokenInfo.- Specified by:
createTokenin interfaceTokenProvider- Parameters:
credentials- The current credentials.- Returns:
- The
TokenInfoassociated with the new login token ornullif no token has been created.
-
createToken
@Nullable public @Nullable TokenInfo createToken(@NotNull @NotNull String userId, @NotNull @NotNull Map<String, ?> attributes) Description copied from interface:TokenProviderIssues a new login token for the user with the givenuserIdand the specified attributes.- Specified by:
createTokenin 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
TokenInfoassociated with the new login token ornullif no token has been created.
-
getTokenInfo
Description copied from interface:TokenProviderRetrieves theTokenInfoassociated with the specified login token ornull.- Specified by:
getTokenInfoin interfaceTokenProvider- Parameters:
token- A valid login token.- Returns:
- the
TokenInfoassociated with the specified login token ornull.
-