public class JwtTokenAuthenticator extends UsernameBasedTokenAuthenticator implements TokenAuthenticator, leap.core.ioc.PostCreateBean
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
CLAIM_NAME |
protected SecurityConfig |
config |
protected leap.core.security.token.jwt.JwtSigner |
signer |
protected leap.core.security.token.jwt.JwtVerifier |
verifier |
sc, USER_NOT_ENABLED_MESSAGE_KEY, USER_NOT_FOUND_MESSAGE_KEY| 构造器和说明 |
|---|
JwtTokenAuthenticator() |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
authenticate(CredentialsAuthenticationContext context,
leap.core.security.Credentials credentials,
leap.lang.Out<leap.core.security.UserPrincipal> user)
Returns
true if this authenticator handles the given Credentials. |
protected Map<String,Object> |
createDefaultClaims(leap.core.security.Authentication auth) |
String |
generateAuthenticationToken(Request request,
Response response,
leap.core.security.Authentication authc)
Generates a token for the
Authentication |
leap.core.security.token.jwt.JwtSigner |
getSigner() |
leap.core.security.token.jwt.JwtVerifier |
getVerifier() |
void |
postCreate(leap.core.BeanFactory factory) |
void |
setSigner(leap.core.security.token.jwt.JwtSigner tokenSigner) |
void |
setVerifier(leap.core.security.token.jwt.JwtVerifier tokenVerifier) |
createClaimsresolveUserDetailsprotected SecurityConfig config
protected leap.core.security.token.jwt.JwtSigner signer
protected leap.core.security.token.jwt.JwtVerifier verifier
public String generateAuthenticationToken(Request request, Response response, leap.core.security.Authentication authc)
TokenAuthenticatorAuthenticationpublic boolean authenticate(CredentialsAuthenticationContext context, leap.core.security.Credentials credentials, leap.lang.Out<leap.core.security.UserPrincipal> user) throws AuthenticationException
CredentialsAuthenticatortrue if this authenticator handles the given Credentials.authenticate 在接口中 CredentialsAuthenticatorAuthenticationExceptionprotected Map<String,Object> createDefaultClaims(leap.core.security.Authentication auth)
public void postCreate(leap.core.BeanFactory factory)
throws Throwable
postCreate 在接口中 leap.core.ioc.PostCreateBeanThrowablepublic leap.core.security.token.jwt.JwtSigner getSigner()
public void setSigner(leap.core.security.token.jwt.JwtSigner tokenSigner)
public leap.core.security.token.jwt.JwtVerifier getVerifier()
public void setVerifier(leap.core.security.token.jwt.JwtVerifier tokenVerifier)
Copyright © 2019. All rights reserved.