Interface CredentialsSupport
-
- All Known Implementing Classes:
CompositeCredentialsSupport,SimpleCredentialsSupport
public interface CredentialsSupportSimple helper interface that allows to easily plug support for additional or customCredentialsimplementations during authentication.
-
-
Method Summary
All Methods Instance Methods Abstract 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.booleansetAttributes(@NotNull Credentials credentials, @NotNull java.util.Map<java.lang.String,?> attributes)Writes the attributes to the specifiedCredentials.
-
-
-
Method Detail
-
getCredentialClasses
@NotNull @NotNull java.util.Set<java.lang.Class> getCredentialClasses()
Returns allcredentialsclasses supported by this implementation.- Returns:
- the supported
credentialsclasses.
-
getUserId
@Nullable @Nullable java.lang.String getUserId(@NotNull @NotNull Credentials credentials)Retrieves 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.- Parameters:
credentials- The credentials as passed to the repository login.- Returns:
- The user id present in the given
Credentialsornull.
-
getAttributes
@NotNull @NotNull java.util.Map<java.lang.String,?> getAttributes(@NotNull @NotNull Credentials credentials)Obtains 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.- Parameters:
credentials- The credentials as passed to the repository login.- Returns:
- The credential attributes or an empty
Map.
-
setAttributes
boolean setAttributes(@NotNull @NotNull Credentials credentials, @NotNull @NotNull java.util.Map<java.lang.String,?> attributes)Writes the attributes to the specifiedCredentials. If the specified credentials are not supported or doesn't allow to write attributes this method will returnfalse.- 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.
-
-