Class CustomExternalIdentityProvider
- java.lang.Object
-
- org.apache.jackrabbit.oak.exercise.security.authentication.external.CustomExternalIdentityProvider
-
- All Implemented Interfaces:
ExternalIdentityProvider
public class CustomExternalIdentityProvider extends Object implements ExternalIdentityProvider
-
-
Constructor Summary
Constructors Constructor Description CustomExternalIdentityProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate(Map<String,Object> properties)
ExternalUser
authenticate(@NotNull Credentials credentials)
Authenticates the user represented by the given credentials and returns it.ExternalGroup
getGroup(@NotNull String name)
Returns the group for the given (local) group name.ExternalIdentity
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.ExternalUser
getUser(@NotNull String userId)
Returns the user for the given (local) id.@NotNull Iterator<ExternalGroup>
listGroups()
List all external groups.@NotNull Iterator<ExternalUser>
listUsers()
List all external users.void
modified(Map<String,Object> properties)
-
-
-
Method Detail
-
getName
@NotNull public @NotNull String getName()
Description copied from interface:ExternalIdentityProvider
Returns the name of this provider.- Specified by:
getName
in interfaceExternalIdentityProvider
- Returns:
- the provider name.
-
getIdentity
public ExternalIdentity getIdentity(@NotNull @NotNull ExternalIdentityRef ref)
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
public ExternalUser getUser(@NotNull @NotNull String userId)
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
public ExternalUser authenticate(@NotNull @NotNull Credentials credentials) throws LoginException
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
public ExternalGroup getGroup(@NotNull @NotNull String name)
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
@NotNull public @NotNull Iterator<ExternalUser> listUsers()
Description copied from interface:ExternalIdentityProvider
List all external users.- Specified by:
listUsers
in interfaceExternalIdentityProvider
- Returns:
- an iterator over all external users
-
listGroups
@NotNull public @NotNull Iterator<ExternalGroup> listGroups()
Description copied from interface:ExternalIdentityProvider
List all external groups.- Specified by:
listGroups
in interfaceExternalIdentityProvider
- Returns:
- an iterator over all external groups
-
-