Interface ExternalIdentityProvider
-
- All Known Implementing Classes:
CustomExternalIdentityProvider,LdapIdentityProvider
public interface ExternalIdentityProviderExternalIdentityProviderdefines an interface to an external system that provides users and groups that can be synced with local ones.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @Nullable ExternalUserauthenticate(@NotNull Credentials credentials)Authenticates the user represented by the given credentials and returns it.@Nullable ExternalGroupgetGroup(@NotNull String name)Returns the group for the given (local) group name.@Nullable ExternalIdentitygetIdentity(@NotNull ExternalIdentityRef ref)Returns the identity for the given reference ornullif it does not exist.@NotNull StringgetName()Returns the name of this provider.@Nullable 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.
-
-
-
Method Detail
-
getName
@NotNull @NotNull String getName()
Returns the name of this provider.- Returns:
- the provider name.
-
getIdentity
@Nullable @Nullable ExternalIdentity getIdentity(@NotNull @NotNull ExternalIdentityRef ref) throws ExternalIdentityException
Returns 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.- Parameters:
ref- the reference- Returns:
- an identity or
null - Throws:
ExternalIdentityException- if an error occurs.
-
getUser
@Nullable @Nullable ExternalUser getUser(@NotNull @NotNull String userId) throws ExternalIdentityException
Returns the user for the given (local) id. if the user does not existnullis returned.- Parameters:
userId- the user id.- Returns:
- the user or
null - Throws:
ExternalIdentityException- if an error occurs.
-
authenticate
@Nullable @Nullable ExternalUser authenticate(@NotNull @NotNull Credentials credentials) throws ExternalIdentityException, LoginException
Authenticates 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.- Parameters:
credentials- the credentials- Returns:
- the user or
null - Throws:
ExternalIdentityException- if an error occursLoginException- if the user could not be authenticated
-
getGroup
@Nullable @Nullable ExternalGroup getGroup(@NotNull @NotNull String name) throws ExternalIdentityException
Returns the group for the given (local) group name. if the group does not existnullis returned.- Parameters:
name- the group name- Returns:
- the group or
null - Throws:
ExternalIdentityException- if an error occurs.
-
listUsers
@NotNull @NotNull Iterator<ExternalUser> listUsers() throws ExternalIdentityException
List all external users.- Returns:
- an iterator over all external users
- Throws:
ExternalIdentityException- if an error occurs.
-
listGroups
@NotNull @NotNull Iterator<ExternalGroup> listGroups() throws ExternalIdentityException
List all external groups.- Returns:
- an iterator over all external groups
- Throws:
ExternalIdentityException- if an error occurs.
-
-