Class CompositeCredentialsSupport
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.security.authentication.credentials.CompositeCredentialsSupport
-
- All Implemented Interfaces:
CredentialsSupport
public final class CompositeCredentialsSupport extends java.lang.Object implements CredentialsSupport
Composite implementation of theCredentialsSupportinterface that handles multiple providers.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull java.util.Map<java.lang.String,?>getAttributes(@NotNull Credentials credentials)Obtains the attributes as present with the specifiedCredentials.@NotNull java.util.Set<java.lang.Class>getCredentialClasses()Returns allcredentialsclasses supported by this implementation.@Nullable java.lang.StringgetUserId(@NotNull Credentials credentials)Retrieves the user identifier from the specifiedCredentials.static CredentialsSupportnewInstance(@NotNull java.util.function.Supplier<java.util.Collection<CredentialsSupport>> credentialSupplier)booleansetAttributes(@NotNull Credentials credentials, @NotNull java.util.Map<java.lang.String,?> attributes)Writes the attributes to the specifiedCredentials.
-
-
-
Method Detail
-
newInstance
public static CredentialsSupport newInstance(@NotNull @NotNull java.util.function.Supplier<java.util.Collection<CredentialsSupport>> credentialSupplier)
-
getCredentialClasses
@NotNull public @NotNull java.util.Set<java.lang.Class> getCredentialClasses()
Description copied from interface:CredentialsSupportReturns allcredentialsclasses supported by this implementation.- Specified by:
getCredentialClassesin interfaceCredentialsSupport- Returns:
- the supported
credentialsclasses.
-
getUserId
@Nullable public @Nullable java.lang.String getUserId(@NotNull @NotNull Credentials credentials)Description copied from interface:CredentialsSupportRetrieves the user identifier from the specifiedCredentials. If the specified credentials are not supported or don't contain any user id information this method will returnnull.- Specified by:
getUserIdin interfaceCredentialsSupport- Parameters:
credentials- The credentials as passed to the repository login.- Returns:
- The user id present in the given
Credentialsornull.
-
getAttributes
@NotNull public @NotNull java.util.Map<java.lang.String,?> getAttributes(@NotNull @NotNull Credentials credentials)Description copied from interface:CredentialsSupportObtains the attributes as present with the specifiedCredentials. If the specified credentials are not supported or don't contain any attributes this method will return an emptyMap.- Specified by:
getAttributesin interfaceCredentialsSupport- Parameters:
credentials- The credentials as passed to the repository login.- Returns:
- The credential attributes or an empty
Map.
-
setAttributes
public boolean setAttributes(@NotNull @NotNull Credentials credentials, @NotNull @NotNull java.util.Map<java.lang.String,?> attributes)Description copied from interface:CredentialsSupportWrites the attributes to the specifiedCredentials. If the specified credentials are not supported or doesn't allow to write attributes this method will returnfalse.- Specified by:
setAttributesin interfaceCredentialsSupport- Parameters:
credentials- The credentials as passed to the repository login.attributes- The attributes to be written to the given credentials.- Returns:
true, if the attributes were set;falseotherwise.
-
-