org.h2.api.UserToRolesMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of h2-mvstore Show documentation
Show all versions of h2-mvstore Show documentation
Fork of h2database to maintain Java 8 compatibility
The newest version!
/*
* Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0,
* and the EPL 1.0 (https://h2database.com/html/license.html).
* Initial Developer: Alessandro Ventura
*/
package org.h2.api;
import java.util.Collection;
import org.h2.security.auth.AuthenticationException;
import org.h2.security.auth.AuthenticationInfo;
import org.h2.security.auth.Configurable;
/**
* A class that implement this interface can be used during authentication to
* map external users to database roles.
*
* This feature is experimental and subject to change
*
*/
public interface UserToRolesMapper extends Configurable {
/**
* Map user identified by authentication info to a set of granted roles.
*
* @param authenticationInfo
* authentication information
* @return list of roles to be assigned to the user temporary
* @throws AuthenticationException
* on authentication exception
*/
Collection mapUserToRoles(AuthenticationInfo authenticationInfo) throws AuthenticationException;
}