When client connectionInfo contains property AUTHREALM={realName} credentials
(typically user id and password) are validated by
org. configured for that realm.
When client connectionInfo doesn't contains AUTHREALM property credentials are validated internally on the database
Rights assignment can be managed through org.
Default configuration has a realm H2 that validate credentials through JAAS api (appName=h2). To customize configuration set h2.authConfigFile system property to refer a valid h2auth.xml config file
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private boolean | |
| public static final String | |
| private boolean | |
| private static DefaultAuthenticator | |
| private boolean | |
| private Map | |
| private boolean | |
| private List |
| Access | Constructor and Description |
|---|---|
| public | |
| public | DefaultAuthenticator(boolean
if true default initialization is skipped skipDefaultInitialization)Create authenticator and optionally skip the default configuration. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addRealm(String
realm name name, CredentialsValidator credentials validator for realm credentialsValidator)Add an authentication realm. |
| public final User | authenticate(AuthenticationInfo
authentication info. authenticationInfo, Database target database instance. database)Implements org. Perform user authentication. |
| private void | |
| public void | configureFromUrl(URL
URL of configuration file configUrl)Configure the authenticator from a configuration file |
| private void | |
| protected static final DefaultAuthenticator | |
| public List | Returns: current UserToRoleMappers activeUserToRoleMappers assign roles to authenticated users |
| public void | init(Database
where authenticator is initialized database)Implements org. Initializes the authenticator. |
| public boolean | Returns: true if creation external user is allowed,
otherwise returns falseIf set create external users in the database if not present. |
| public boolean | Returns: true if not found roles will be created,
false roles are silently skipped.When set create roles not found in the database. |
| public boolean | Returns: true if user will be persisted,
otherwise returns falseIf set save users externals defined during the authentication. |
| public void | setAllowUserRegistration(boolean
true if creation external user is allowed,
otherwise returns falseIf set to |
| public void | setCreateMissingRoles(boolean
when is createMissingRoles)true not found roles are created,
when is false roles are silently skipped.Sets the flag that define behavior in case external roles not found in the database. |
| public void | setPersistUsers(boolean
true if user will be persisted,
otherwise false.If set to |
| public void | |
| private boolean |
| allowUserRegistration | back to summary |
|---|---|
| private boolean allowUserRegistration | |
| createMissingRoles | back to summary |
|---|---|
| private boolean createMissingRoles | |
| DEFAULT_REALMNAME | back to summary |
|---|---|
| public static final String DEFAULT_REALMNAME | |
| initialized | back to summary |
|---|---|
| private boolean initialized | |
| instance | back to summary |
|---|---|
| private static DefaultAuthenticator instance | |
| persistUsers | back to summary |
|---|---|
| private boolean persistUsers | |
| realms | back to summary |
|---|---|
| private Map<String, CredentialsValidator> realms | |
| skipDefaultInitialization | back to summary |
|---|---|
| private boolean skipDefaultInitialization | |
| userToRolesMappers | back to summary |
|---|---|
| private List<UserToRolesMapper> userToRolesMappers | |
| DefaultAuthenticator | back to summary |
|---|---|
| public DefaultAuthenticator() Create the Authenticator with default configurations | |
| DefaultAuthenticator | back to summary |
|---|---|
| public DefaultAuthenticator(boolean skipDefaultInitialization) Create authenticator and optionally skip the default configuration. This option is useful when the authenticator is configured at code level
| |
| addRealm | back to summary |
|---|---|
| public void addRealm(String name, CredentialsValidator credentialsValidator) Add an authentication realm. Realms are case insensitive
| |
| authenticate | back to summary |
|---|---|
| public final User authenticate(AuthenticationInfo authenticationInfo, Database database) throws AuthenticationException Implements org. Doc from org. Perform user authentication.
| |
| configureFrom | back to summary |
|---|---|
| private void configureFrom(H2AuthConfig config) throws AuthenticationException | |
| configureFromUrl | back to summary |
|---|---|
| public void configureFromUrl(URL configUrl) throws AuthenticationException, SAXException, IOException, ParserConfigurationException Configure the authenticator from a configuration file
| |
| defaultConfiguration | back to summary |
|---|---|
| private void defaultConfiguration() | |
| getInstance | back to summary |
|---|---|
| protected static final DefaultAuthenticator getInstance() | |
| getUserToRolesMappers | back to summary |
|---|---|
| public List UserToRoleMappers assign roles to authenticated users
| |
| init | back to summary |
|---|---|
| public void init(Database database) throws AuthConfigException Implements org. Initializes the authenticator. this method is skipped if skipDefaultInitialization is set Order of initialization is
| |
| isAllowUserRegistration | back to summary |
|---|---|
| public boolean isAllowUserRegistration() If set create external users in the database if not present.
| |
| isCreateMissingRoles | back to summary |
|---|---|
| public boolean isCreateMissingRoles() When set create roles not found in the database. If not set roles not found in the database are silently skipped.
| |
| isPersistUsers | back to summary |
|---|---|
| public boolean isPersistUsers() If set save users externals defined during the authentication.
| |
| setAllowUserRegistration | back to summary |
|---|---|
| public void setAllowUserRegistration(boolean allowUserRegistration) If set to
| |
| setCreateMissingRoles | back to summary |
|---|---|
| public void setCreateMissingRoles(boolean createMissingRoles) Sets the flag that define behavior in case external roles not found in the database.
| |
| setPersistUsers | back to summary |
|---|---|
| public void setPersistUsers(boolean persistUsers) If set to
| |
| setUserToRolesMappers | back to summary |
|---|---|
| public void setUserToRolesMappers(UserToRolesMapper... userToRolesMappers) | |
| updateRoles | back to summary |
|---|---|
| private boolean updateRoles(AuthenticationInfo authenticationInfo, User user, Database database) throws AuthenticationException | |