[feat]:用户微信登录模块
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
package com.central.oauth2.common.token;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.oauth2.core.AuthorizationGrantType;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @author: lsl
|
||||
* @date: 2024/12/16
|
||||
* <p>
|
||||
* Blog: https://zlt2000.gitee.io
|
||||
* Github: https://github.com/zlt2000
|
||||
*/
|
||||
@Getter
|
||||
public class TencentAuthenticationToken extends BaseAuthenticationToken {
|
||||
public static final AuthorizationGrantType GRANT_TYPE = new AuthorizationGrantType("tencent");
|
||||
private final Object principal;
|
||||
|
||||
public TencentAuthenticationToken(String code) {
|
||||
super(GRANT_TYPE);
|
||||
this.principal = code;
|
||||
super.setAuthenticated(true);
|
||||
}
|
||||
|
||||
public TencentAuthenticationToken(UserDetails user, Collection<? extends GrantedAuthority> authorities) {
|
||||
super(authorities);
|
||||
this.principal = user;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user