Class CustomExternalIdentityProvider
java.lang.Object
org.apache.jackrabbit.oak.exercise.security.authentication.external.CustomExternalIdentityProvider
- All Implemented Interfaces:
ExternalIdentityProvider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
authenticate
(@NotNull Credentials credentials) Authenticates the user represented by the given credentials and returns it.Returns the group for the given (local) group name.getIdentity
(@NotNull ExternalIdentityRef ref) Returns the identity for the given reference ornull
if it does not exist.@NotNull String
getName()
Returns the name of this provider.Returns the user for the given (local) id.@NotNull Iterator<ExternalGroup>
List all external groups.@NotNull Iterator<ExternalUser>
List all external users.void
-
Constructor Details
-
CustomExternalIdentityProvider
public CustomExternalIdentityProvider()
-
-
Method Details
-
activate
-
modified
-
getName
Description copied from interface:ExternalIdentityProvider
Returns the name of this provider.- Specified by:
getName
in interfaceExternalIdentityProvider
- Returns:
- the provider name.
-
getIdentity
Description copied from interface:ExternalIdentityProvider
Returns the identity for the given reference ornull
if it does not exist. The provider should check if theprovider name
matches his own name or isnull
and should not return a foreign identity.- Specified by:
getIdentity
in interfaceExternalIdentityProvider
- Parameters:
ref
- the reference- Returns:
- an identity or
null
-
getUser
Description copied from interface:ExternalIdentityProvider
Returns the user for the given (local) id. if the user does not existnull
is returned.- Specified by:
getUser
in interfaceExternalIdentityProvider
- Parameters:
userId
- the user id.- Returns:
- the user or
null
-
authenticate
Description copied from interface:ExternalIdentityProvider
Authenticates the user represented by the given credentials and returns it. If the user does not exist in this provider,null
is returned. If the authentication fails, a LoginException is thrown.- Specified by:
authenticate
in interfaceExternalIdentityProvider
- Parameters:
credentials
- the credentials- Returns:
- the user or
null
- Throws:
LoginException
- if the user could not be authenticated
-
getGroup
Description copied from interface:ExternalIdentityProvider
Returns the group for the given (local) group name. if the group does not existnull
is returned.- Specified by:
getGroup
in interfaceExternalIdentityProvider
- Parameters:
name
- the group name- Returns:
- the group or
null
-
listUsers
Description copied from interface:ExternalIdentityProvider
List all external users.- Specified by:
listUsers
in interfaceExternalIdentityProvider
- Returns:
- an iterator over all external users
-
listGroups
Description copied from interface:ExternalIdentityProvider
List all external groups.- Specified by:
listGroups
in interfaceExternalIdentityProvider
- Returns:
- an iterator over all external groups
-