All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.acegisecurity.userdetails.UserDetails Maven / Gradle / Ivy

There is a newer version: 1.0.7
Show newest version
/* Copyright 2004, 2005 Acegi Technology Pty Limited
 *
 * 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.
 */

package org.acegisecurity.userdetails;

import java.io.Serializable;

import org.acegisecurity.Authentication;
import org.acegisecurity.GrantedAuthority;


/**
 * Provides core user information.
 * 
 * 

* Implementations are not used directly by Acegi Security for security * purposes. They simply store user information which is later encapsulated * into {@link Authentication} objects. This allows non-security related user * information (such as email addresses, telephone numbers etc) to be stored * in a convenient location. *

* *

* Concrete implementations must take particular care to ensure the non-null * contract detailed for each method is enforced. See * {@link org.acegisecurity.userdetails.User} for a * reference implementation (which you might like to extend). *

* * @author Ben Alex * @version $Id: UserDetails.java,v 1.8 2005/12/22 01:18:32 luke_t Exp $ */ public interface UserDetails extends Serializable { //~ Methods ================================================================ /** * Indicates whether the user's account has expired. An expired account * cannot be authenticated. * * @return true if the user's account is valid (ie * non-expired), false if no longer valid (ie * expired) */ public boolean isAccountNonExpired(); /** * Indicates whether the user is locked or unlocked. A locked user cannot * be authenticated. * * @return true if the user is not locked, false * otherwise */ public boolean isAccountNonLocked(); /** * Returns the authorities granted to the user. Cannot return * null. * * @return the authorities (never null) */ public GrantedAuthority[] getAuthorities(); /** * Indicates whether the user's credentials (password) has expired. Expired * credentials prevent authentication. * * @return true if the user's credentials are valid (ie * non-expired), false if no longer valid (ie * expired) */ public boolean isCredentialsNonExpired(); /** * Indicates whether the user is enabled or disabled. A disabled user * cannot be authenticated. * * @return true if the user is enabled, false * otherwise */ public boolean isEnabled(); /** * Returns the password used to authenticate the user. Cannot return * null. * * @return the password (never null) */ public String getPassword(); /** * Returns the username used to authenticate the user. Cannot return * null. * * @return the username (never null) */ public String getUsername(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy