/*
* Copyright 2005-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This package provides support for managing users and their authentication.
*
*
Supported use cases
*
* in particular, it supports the following use cases:
*
* - Dynamically manage users and groups from an application.
*
* - Authenticate users
*
* - Store users and groups in a database.
*
*
*
* An overview is given below:
*
*
*
*
* The user of the package interacts with the {@link UserAdministration} interface for the following tasks:
*
* - Adding users and removing users
* - Adding users to groups and removing them from groups
* - Renaming users and groups
* - Modifying the user's password
* - Populate with initial users upon first startup
*
* In addition, it provides methods for authenticating the user. Note however that it is also possible
* to use declarative Java EE security using the appropriate security realm. See for instance,
* flexible JDBC realm for a Glassfish based solution.
*
* {@link UserAdminInitializer} can be used to automatically initialize the user administration with
* initial users and groups when there are no users defined yet.
*
* To use the user administration interface, several implementation classes must be wired together. This is
* explained below.
*
* There is one implementation {@link UserAdministrationImpl} of this interface that must be constructed
* with a {@link UserSet} and {@link GroupSet} implementation, together with two validators: one for
* user names and another for group names.
*
* For user and groups sets there are two implementations, one inmemory and another with database persistence.
* Typically the one with database persistence is used but for testing other code, the inmemory implementation
* can be used.
*
*
*
*
* At construction of the userset, a password validator is required as well as a digest algorithm to
* compute a digest of the password to store in the database and also to validate users against.
*
*
*
*
* Finally, there is the basic model for users and groups that is used under the covers. As a user
* of the security library these objects will typically not be used.
*
*
*
*/
package org.wamblee.security.authentication;