🔀 合并分支

This commit is contained in:
yadong.zhang 2019-08-06 18:14:35 +08:00
parent 4f303705d9
commit cf77e4d0e0

View File

@ -283,7 +283,22 @@ public class AuthRequestTest {
AuthRequest authRequest = new AuthHuaweiRequest(AuthConfig.builder()
.clientId("clientId")
.clientSecret("clientSecret")
.redirectUri("redirectUri")
.redirectUri("http://redirectUri")
.build());
// 返回授权页面可自行跳转
authRequest.authorize("state");
// 授权登录后会返回codeauth_code仅限支付宝state1.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());
// 返回授权页面可自行跳转
authRequest.authorize("state");