提交 b08b8290 编写于 作者: laizhilong's avatar laizhilong

微信授权登录、钉钉授权登录

上级 8ffdfae1
...@@ -38,9 +38,9 @@ public class UserDingtalkRegisterResource { ...@@ -38,9 +38,9 @@ public class UserDingtalkRegisterResource {
@Qualifier("UAAUserService") @Qualifier("UAAUserService")
private AuthenticationUserService userDetailsService; private AuthenticationUserService userDetailsService;
@Value("${ibiz.auth.dingtalk.appid:dingoatysxi5rpbluqgzpk}") @Value("${ibiz.auth.dingtalk.appid:dingoatysxi5rpbluqgzpk}")// 个人应用开发过程中的唯一性标识AppId,最好在配置文件进行初始化
private String DingtalkAppid; private String DingtalkAppid;
@Value("${ibiz.auth.dingtalk.appid:z2SuCSciWQJ6VSFX8jvHzTF0G_rEmHpjHrZct0rGnWrLyl8cZiRny72244EvF4SO}") @Value("${ibiz.auth.dingtalk.appid:z2SuCSciWQJ6VSFX8jvHzTF0G_rEmHpjHrZct0rGnWrLyl8cZiRny72244EvF4SO}")// 个人应用AppSecret,最好在配置文件进行初始化
private String DingtalkAppSecret; private String DingtalkAppSecret;
@Value("${ibiz.auth.dingtalk.openid:}") @Value("${ibiz.auth.dingtalk.openid:}")
private String DingtalkOpenid; private String DingtalkOpenid;
...@@ -181,6 +181,7 @@ public class UserDingtalkRegisterResource { ...@@ -181,6 +181,7 @@ public class UserDingtalkRegisterResource {
ibzuser.setLoginname(loginname); ibzuser.setLoginname(loginname);
ibzuser.setUserid("dingtalk-" + uuid); ibzuser.setUserid("dingtalk-" + uuid);
ibzuser.setPersonname(nickname); ibzuser.setPersonname(nickname);
ibzuser.setNickname(nickname);
ibzuser.setAvatar(openid); ibzuser.setAvatar(openid);
userDingtalkRegisterService.toRegister(ibzuser); userDingtalkRegisterService.toRegister(ibzuser);
} }
......
...@@ -7,12 +7,12 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -7,12 +7,12 @@ import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
public class UserQQRegisterResource { public class UserQQRegisterResource {
@Value("${ibiz.auth.qq.appid:101881963}") @Value("${ibiz.auth.qq.appid:}")// qq互联appid
private String qqAppId;// qq互联appid private String qqAppId;
@Value("${ibiz.auth.qq.appkey:}") @Value("${ibiz.auth.qq.appkey:}")// qq互联appkey
private String qqAppKey;// qq互联appkey private String qqAppKey;
@Value("${ibiz.auth.qq.redirect_uri:}") @Value("${ibiz.auth.qq.redirect_uri:}")// qq互联应用回调地址
private String qqRedirectUri;// qq互联应用回调地址 private String qqRedirectUri;
} }
...@@ -39,20 +39,20 @@ public class UserWechatRegisterResource { ...@@ -39,20 +39,20 @@ public class UserWechatRegisterResource {
@Qualifier("UAAUserService") @Qualifier("UAAUserService")
private AuthenticationUserService userDetailsService; private AuthenticationUserService userDetailsService;
@Value("${ibiz.auth.wechat.appID:wx4a7473ac9c617f76}") @Value("${ibiz.auth.wechat.appID:wx4a7473ac9c617f76}")// 微信开放平台appid,最好在配置文件进行初始化
private String WechatAppid; // 微信开放平台appid private String WechatAppid;
@Value("${ibiz.auth.wechat.appsecret:c2b308b9245dffa316b049840fd81a79}") @Value("${ibiz.auth.wechat.appsecret:c2b308b9245dffa316b049840fd81a79}")// 微信开放平台appsecret,最好在配置文件进行初始化
private String WechatAppsecret; // 微信开放平台appsecret private String WechatAppsecret;
@Value("${ibiz.auth.wechat.openid:}") @Value("${ibiz.auth.wechat.openid:}")
private String WechatOpenid; private String WechatOpenid;
@Value("${ibiz.auth.wechat.nickname:}") @Value("${ibiz.auth.wechat.nickname:}")
private String WechatNickname; private String WechatNickname;
public static final String TOKEN = "weixin"; // 这里的token要和微信公众测试号网页填写的token一致 public static final String TOKEN = ""; // 这里的token要和微信公众测试号网页填写的token一致
/** /**
* 响应微信公众测试号发送的Token验证 * 响应微信公众测试号发送的Token验证
* * ps:仅在测试号需要token验证,正式号不需要
* @param signature  微信加密签名,signature结合了开发者填写的token参数和请求中的timestamp参数、nonce参数 * @param signature  微信加密签名,signature结合了开发者填写的token参数和请求中的timestamp参数、nonce参数
* @param timestamp  时间戳 * @param timestamp  时间戳
* @param nonce  随机数 * @param nonce  随机数
...@@ -223,6 +223,7 @@ public class UserWechatRegisterResource { ...@@ -223,6 +223,7 @@ public class UserWechatRegisterResource {
ibzuser.setLoginname(loginname); ibzuser.setLoginname(loginname);
ibzuser.setUserid("wechat-" + uuid); ibzuser.setUserid("wechat-" + uuid);
ibzuser.setPersonname(returnObj.getString("nickname")); ibzuser.setPersonname(returnObj.getString("nickname"));
ibzuser.setNickname(returnObj.getString("nickname"));
ibzuser.setAvatar(returnObj.getString("openid")); ibzuser.setAvatar(returnObj.getString("openid"));
userWechatRegisterService.toRegister(ibzuser); userWechatRegisterService.toRegister(ibzuser);
...@@ -235,6 +236,7 @@ public class UserWechatRegisterResource { ...@@ -235,6 +236,7 @@ public class UserWechatRegisterResource {
ibzuser.setLoginname(loginname); ibzuser.setLoginname(loginname);
ibzuser.setUserid("wechat-" + uuid); ibzuser.setUserid("wechat-" + uuid);
ibzuser.setPersonname(nickname); ibzuser.setPersonname(nickname);
ibzuser.setNickname(nickname);
ibzuser.setAvatar(openid); ibzuser.setAvatar(openid);
userWechatRegisterService.toRegister(ibzuser); userWechatRegisterService.toRegister(ibzuser);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册