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 ofTokenProviders 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 TokenInfocreateToken(@NotNull java.lang.String userId, @NotNull java.util.Map<java.lang.String,?> attributes)Issues a new login token for the user with the givenuserIdand the specified attributes.@Nullable TokenInfocreateToken(@NotNull javax.jcr.Credentials credentials)Issues a new login token for the user with the specified credentials and returns the associatedTokenInfo.booleandoCreateToken(@NotNull javax.jcr.Credentials credentials)Returnstrueif the given credentials indicate that a new token needs to be issued.@Nullable TokenInfogetTokenInfo(@NotNull java.lang.String token)Retrieves theTokenInfoassociated with the specified login token ornull.static @NotNull TokenProvidernewInstance(@NotNull java.util.List<? extends TokenProvider> providers)static @NotNull TokenProvidernewInstance(@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 javax.jcr.Credentials credentials)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
@Nullable public @Nullable TokenInfo createToken(@NotNull @NotNull javax.jcr.Credentials credentials)
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 java.lang.String userId, @NotNull @NotNull java.util.Map<java.lang.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
@Nullable public @Nullable TokenInfo getTokenInfo(@NotNull @NotNull java.lang.String token)
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.
-
-