public abstract class AbstractAdapterAuthenticationToken extends AbstractAuthenticationToken implements AuthByAdapter
AuthByAdapter
implementations.Modifier | Constructor and Description |
---|---|
protected |
AbstractAdapterAuthenticationToken() |
protected |
AbstractAdapterAuthenticationToken(String key,
GrantedAuthority[] authorities)
The only way an
AbstractAdapterAuthentication should be
constructed. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
int |
getKeyHash()
Returns the hash code of the key that was passed to the constructor of the
AuthByAdapter
implementation. |
boolean |
isAuthenticated()
Always returns
true . |
boolean |
isUserInRole(String role)
Iterates the granted authorities and indicates whether or not the specified role is held.
|
void |
setAuthenticated(boolean ignored)
Setting is ignored.
|
getAuthorities, getDetails, getName, hashCode, setDetails, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getAuthorities, getCredentials, getDetails, getPrincipal
protected AbstractAdapterAuthenticationToken()
protected AbstractAdapterAuthenticationToken(String key, GrantedAuthority[] authorities)
AbstractAdapterAuthentication
should be
constructed.key
- the key that is hashed and made available via getKeyHash()
authorities
- the authorities granted to this principalpublic boolean equals(Object obj)
equals
in interface Principal
equals
in class AbstractAuthenticationToken
public int getKeyHash()
AuthByAdapter
AuthByAdapter
implementation. The implementation should convert the value to a hash code at construction time, rather than
storing the key itself.getKeyHash
in interface AuthByAdapter
public boolean isAuthenticated()
true
.isAuthenticated
in interface Authentication
isAuthenticated
in class AbstractAuthenticationToken
public boolean isUserInRole(String role)
Comparison
is based on the String
returned by GrantedAuthority.getAuthority()
.
role
- the role being searched for in this object's granted authorities listtrue
if the granted authority is held, or false
otherwisepublic void setAuthenticated(boolean ignored)
setAuthenticated
in interface Authentication
setAuthenticated
in class AbstractAuthenticationToken
ignored
- DOCUMENT ME!Copyright © 2015. All rights reserved.