类 MapAuthentication
- 所有已实现的接口:
Serializable,Principal,org.springframework.security.core.Authentication
- 版本:
- $Id: $Id
- 作者:
- zhanglinfeng
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Collection<? extends org.springframework.security.core.GrantedAuthority> getName()booleanvoidsetAuthenticated(boolean isAuthenticated) voidsetAuthorities(Collection<org.springframework.security.core.GrantedAuthority> authorities) voidsetPrincipal(Object principal)
-
构造器详细资料
-
MapAuthentication
Constructor for MapAuthentication.
- 参数:
userBaseInfo- aUserBaseInfoobject
-
-
方法详细资料
-
getAuthorities
Set by an
AuthenticationManagerto indicate the authorities that the principal has been granted. Note that classes should not rely on this value as being valid unless it has been set by a trustedAuthenticationManager.Implementations should ensure that modifications to the returned collection array do not affect the state of the Authentication object, or use an unmodifiable instance.
- 指定者:
getAuthorities在接口中org.springframework.security.core.Authentication
-
getCredentials
The credentials that prove the principal is correct. This is usually a password, but could be anything relevant to the
AuthenticationManager. Callers are expected to populate the credentials.- 指定者:
getCredentials在接口中org.springframework.security.core.Authentication
-
getDetails
Stores additional details about the authentication request. These might be an IP address, certificate serial number etc.
- 指定者:
getDetails在接口中org.springframework.security.core.Authentication
-
getPrincipal
The identity of the principal being authenticated. In the case of an authentication request with username and password, this would be the username. Callers are expected to populate the principal for an authentication request.
The AuthenticationManager implementation will often return an Authentication containing richer information as the principal for use by the application. Many of the authentication providers will create a
UserDetailsobject as the principal.- 指定者:
getPrincipal在接口中org.springframework.security.core.Authentication
-
isAuthenticated
public boolean isAuthenticated()Used to indicate to
AbstractSecurityInterceptorwhether it should present the authentication token to theAuthenticationManager. Typically anAuthenticationManager(or, more often, one of itsAuthenticationProviders) will return an immutable authentication token after successful authentication, in which case that token can safely returntrueto this method. Returningtruewill improve performance, as calling theAuthenticationManagerfor every request will no longer be necessary.For security reasons, implementations of this interface should be very careful about returning
truefrom this method unless they are either immutable, or have some way of ensuring the properties have not been changed since original creation.- 指定者:
isAuthenticated在接口中org.springframework.security.core.Authentication
-
setAuthenticated
See
isAuthenticated()for a full description.Implementations should always allow this method to be called with a
falseparameter, as this is used by various classes to specify the authentication token should not be trusted. If an implementation wishes to reject an invocation with atrueparameter (which would indicate the authentication token is trusted - a potential security risk) the implementation should throw anIllegalArgumentException.- 指定者:
setAuthenticated在接口中org.springframework.security.core.Authentication- 抛出:
IllegalArgumentException
-
getName
Returns the name of this principal.
-
setAuthorities
public void setAuthorities(Collection<org.springframework.security.core.GrantedAuthority> authorities) -
setPrincipal
-