mirror of
https://gitee.com/yadong.zhang/JustAuth.git
synced 2025-12-06 08:48:27 +08:00
💩 添加新版企业微信扫码登录能力(PS. 新版企业微信登录,除了支持使用移动端企业微信扫码登录之外,还支持通过企业微信桌面端进行快速登录。)
This commit is contained in:
parent
0eafb96a43
commit
5d521e3ea4
@ -198,4 +198,20 @@ public class AuthConfig {
|
|||||||
* @see <a href="https://developer.apple.com/help/glossary/team-id/">team id</a>
|
* @see <a href="https://developer.apple.com/help/glossary/team-id/">team id</a>
|
||||||
*/
|
*/
|
||||||
private String teamId;
|
private String teamId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新版企业微信 Web 登录时的参数,
|
||||||
|
*
|
||||||
|
* 登录类型。ServiceApp:服务商登录;CorpApp:企业自建/代开发应用登录。
|
||||||
|
* @see <a href="https://developer.work.weixin.qq.com/document/path/98152">https://developer.work.weixin.qq.com/document/path/98152</a>
|
||||||
|
* @since 1.16.7
|
||||||
|
*/
|
||||||
|
private String loginType = "CorpApp";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 语言编码
|
||||||
|
*
|
||||||
|
* @since 1.16.7
|
||||||
|
*/
|
||||||
|
private String lang = "zh";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -764,6 +764,32 @@ public enum AuthDefaultSource implements AuthSource {
|
|||||||
return AuthWeChatEnterpriseQrcodeRequest.class;
|
return AuthWeChatEnterpriseQrcodeRequest.class;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* 新版企业微信 Web 登录(扫码),参考 <a href="https://developer.work.weixin.qq.com/document/path/98152">https://developer.work.weixin.qq.com/document/path/98152</a>
|
||||||
|
*
|
||||||
|
* @since 1.16.7
|
||||||
|
*/
|
||||||
|
WECHAT_ENTERPRISE_V2 {
|
||||||
|
@Override
|
||||||
|
public String authorize() {
|
||||||
|
return "https://login.work.weixin.qq.com/wwlogin/sso/login";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String accessToken() {
|
||||||
|
return "https://qyapi.weixin.qq.com/cgi-bin/gettoken";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String userInfo() {
|
||||||
|
return "https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends AuthDefaultRequest> getTargetClass() {
|
||||||
|
return AuthWeChatEnterpriseQrcodeV2Request.class;
|
||||||
|
}
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 企业微信二维码第三方登录
|
* 企业微信二维码第三方登录
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -33,6 +33,7 @@ public enum AuthResponseStatus {
|
|||||||
ILLEGAL_TEAM_ID(5013, "Invalid team id"),
|
ILLEGAL_TEAM_ID(5013, "Invalid team id"),
|
||||||
ILLEGAL_CLIENT_ID(5014, "Invalid client id"),
|
ILLEGAL_CLIENT_ID(5014, "Invalid client id"),
|
||||||
ILLEGAL_CLIENT_SECRET(5015, "Invalid client secret"),
|
ILLEGAL_CLIENT_SECRET(5015, "Invalid client secret"),
|
||||||
|
ILLEGAL_WECHAT_AGENT_ID(5016, "Illegal wechat agent id"),
|
||||||
;
|
;
|
||||||
|
|
||||||
private final int code;
|
private final int code;
|
||||||
|
|||||||
@ -31,6 +31,7 @@ public class AuthWeChatEnterpriseQrcodeRequest extends AbstractAuthWeChatEnterpr
|
|||||||
.queryParam("agentid", config.getAgentId())
|
.queryParam("agentid", config.getAgentId())
|
||||||
.queryParam("redirect_uri", config.getRedirectUri())
|
.queryParam("redirect_uri", config.getRedirectUri())
|
||||||
.queryParam("state", getRealState(state))
|
.queryParam("state", getRealState(state))
|
||||||
|
.queryParam("lang", config.getLang())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user