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 voidactivate(Map<String,Object> properties)ExternalUserauthenticate(@NotNull Credentials credentials)Authenticates the user represented by the given credentials and returns it.ExternalGroupgetGroup(@NotNull String name)Returns the group for the given (local) group name.ExternalIdentitygetIdentity(@NotNull ExternalIdentityRef ref)Returns the identity for the given reference ornullif it does not exist.@NotNull StringgetName()Returns the name of this provider.ExternalUsergetUser(@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.voidmodified(Map<String,Object> properties)
-
-
-
Method Detail
-
getName
@NotNull public @NotNull String getName()
Description copied from interface:ExternalIdentityProviderReturns the name of this provider.- Specified by:
getNamein interfaceExternalIdentityProvider- Returns:
- the provider name.
-
getIdentity
public ExternalIdentity getIdentity(@NotNull @NotNull ExternalIdentityRef ref)
Description copied from interface:ExternalIdentityProviderReturns the identity for the given reference ornullif it does not exist. The provider should check if theprovider namematches his own name or isnulland should not return a foreign identity.- Specified by:
getIdentityin interfaceExternalIdentityProvider- Parameters:
ref- the reference- Returns:
- an identity or
null
-
getUser
public ExternalUser getUser(@NotNull @NotNull String userId)
Description copied from interface:ExternalIdentityProviderReturns the user for the given (local) id. if the user does not existnullis returned.- Specified by:
getUserin 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:ExternalIdentityProviderAuthenticates the user represented by the given credentials and returns it. If the user does not exist in this provider,nullis returned. If the authentication fails, a LoginException is thrown.- Specified by:
authenticatein 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:ExternalIdentityProviderReturns the group for the given (local) group name. if the group does not existnullis returned.- Specified by:
getGroupin interfaceExternalIdentityProvider- Parameters:
name- the group name- Returns:
- the group or
null
-
listUsers
@NotNull public @NotNull Iterator<ExternalUser> listUsers()
Description copied from interface:ExternalIdentityProviderList all external users.- Specified by:
listUsersin interfaceExternalIdentityProvider- Returns:
- an iterator over all external users
-
listGroups
@NotNull public @NotNull Iterator<ExternalGroup> listGroups()
Description copied from interface:ExternalIdentityProviderList all external groups.- Specified by:
listGroupsin interfaceExternalIdentityProvider- Returns:
- an iterator over all external groups
-
-