🔀 合并分支
This commit is contained in:
@@ -283,7 +283,22 @@ public class AuthRequestTest {
|
|||||||
AuthRequest authRequest = new AuthHuaweiRequest(AuthConfig.builder()
|
AuthRequest authRequest = new AuthHuaweiRequest(AuthConfig.builder()
|
||||||
.clientId("clientId")
|
.clientId("clientId")
|
||||||
.clientSecret("clientSecret")
|
.clientSecret("clientSecret")
|
||||||
.redirectUri("redirectUri")
|
.redirectUri("http://redirectUri")
|
||||||
|
.build());
|
||||||
|
// 返回授权页面,可自行跳转
|
||||||
|
authRequest.authorize("state");
|
||||||
|
// 授权登录后会返回code(auth_code(仅限支付宝))、state,1.8.0版本后,可以用AuthCallback类作为回调接口的入参
|
||||||
|
// 注:JustAuth默认保存state的时效为3分钟,3分钟内未使用则会自动清除过期的state
|
||||||
|
AuthResponse login = authRequest.login(new AuthCallback());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void weChatEnterpriseTest() {
|
||||||
|
AuthRequest authRequest = new AuthWeChatEnterpriseRequest(AuthConfig.builder()
|
||||||
|
.clientId("clientId")
|
||||||
|
.clientSecret("clientSecret")
|
||||||
|
.redirectUri("http://redirectUri")
|
||||||
|
.agentId("agentId")
|
||||||
.build());
|
.build());
|
||||||
// 返回授权页面,可自行跳转
|
// 返回授权页面,可自行跳转
|
||||||
authRequest.authorize("state");
|
authRequest.authorize("state");
|
||||||
|
|||||||
Reference in New Issue
Block a user