public class SmsAuthenticationToken extends org.springframework.security.authentication.AbstractAuthenticationToken implements Serializable
| Constructor and Description |
|---|
SmsAuthenticationToken(String mobile)
This constructor can be safely used by any code that wishes to create a
UsernamePasswordAuthenticationToken, as the AbstractAuthenticationToken.isAuthenticated()
will return false. |
SmsAuthenticationToken(String mobile,
Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
This constructor should only be used by
AuthenticationManager or
AuthenticationProvider implementations that are satisfied with
producing a trusted (i.e. |
| Modifier and Type | Method and Description |
|---|---|
void |
eraseCredentials() |
Object |
getCredentials() |
String |
getMobile() |
Object |
getPrincipal() |
void |
setAuthenticated(boolean isAuthenticated) |
equals, getAuthorities, getDetails, getName, hashCode, isAuthenticated, setDetails, toStringpublic SmsAuthenticationToken(String mobile)
UsernamePasswordAuthenticationToken, as the AbstractAuthenticationToken.isAuthenticated()
will return false.mobile - 手机号public SmsAuthenticationToken(String mobile, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
AuthenticationManager or
AuthenticationProvider implementations that are satisfied with
producing a trusted (i.e. AbstractAuthenticationToken.isAuthenticated() = true)
authentication token.mobile - 手机号authorities - 认证角色public Object getCredentials()
getCredentials in interface org.springframework.security.core.Authenticationpublic Object getPrincipal()
getPrincipal in interface org.springframework.security.core.Authenticationpublic String getMobile()
public void setAuthenticated(boolean isAuthenticated)
throws IllegalArgumentException
setAuthenticated in interface org.springframework.security.core.AuthenticationsetAuthenticated in class org.springframework.security.authentication.AbstractAuthenticationTokenIllegalArgumentExceptionpublic void eraseCredentials()
eraseCredentials in interface org.springframework.security.core.CredentialsContainereraseCredentials in class org.springframework.security.authentication.AbstractAuthenticationTokenCopyright © 2021. All rights reserved.