forked from youlaitech/youlai-mall
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
84aa6da
commit 9a99197
Showing
31 changed files
with
566 additions
and
456 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...main/java/com/youlai/auth/authentication/wechat/WeChatMiniProgramAuthenticationToken.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package com.youlai.auth.authentication.wechat; | ||
|
||
import lombok.Getter; | ||
import org.springframework.security.core.Authentication; | ||
import org.springframework.security.oauth2.core.AuthorizationGrantType; | ||
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2AuthorizationCodeAuthenticationToken; | ||
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2AuthorizationGrantAuthenticationToken; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* 微信小程序 | ||
* | ||
* @author haoxr | ||
* @see OAuth2AuthorizationCodeAuthenticationToken | ||
* @since 3.0.0 | ||
*/ | ||
public class WeChatMiniProgramAuthenticationToken extends OAuth2AuthorizationGrantAuthenticationToken { | ||
|
||
/** | ||
* 授权类型:微信小程序 | ||
*/ | ||
public static final AuthorizationGrantType WECHAT_MINI_PROGRAM = new AuthorizationGrantType("wechat_mini_program"); | ||
|
||
@Getter | ||
private final String code; | ||
|
||
@Getter | ||
private final String encryptedData; | ||
|
||
@Getter | ||
private final String iv; | ||
|
||
|
||
/** | ||
* @see org.springframework.security.oauth2.core.endpoint.OAuth2ParameterNames#SCOPE | ||
*/ | ||
private final String scope; | ||
|
||
|
||
/** | ||
* Sub-class constructor. | ||
* | ||
* @param clientPrincipal the authenticated client principal | ||
* @param additionalParameters the additional parameters | ||
*/ | ||
protected WeChatMiniProgramAuthenticationToken( | ||
Authentication clientPrincipal, | ||
Map<String, Object> additionalParameters, | ||
String code, | ||
String encryptedData, | ||
String iv, | ||
String scope | ||
) { | ||
super(WeChatMiniProgramAuthenticationToken.WECHAT_MINI_PROGRAM, clientPrincipal, additionalParameters); | ||
this.code = code; | ||
this.encryptedData = encryptedData; | ||
this.iv = iv; | ||
this.scope = scope; | ||
} | ||
} |
Oops, something went wrong.