mirror of
https://gitee.com/dromara/MaxKey.git
synced 2026-05-23 00:28:11 +08:00
SocialSignOn
This commit is contained in:
@@ -39,6 +39,7 @@ public class AuthJwt implements Serializable {
|
||||
private String email;
|
||||
private String instId;
|
||||
private String instName;
|
||||
private int passwordSetType;
|
||||
private List<String> authorities;
|
||||
|
||||
|
||||
@@ -147,6 +148,15 @@ public class AuthJwt implements Serializable {
|
||||
public void setTicket(String ticket) {
|
||||
this.ticket = ticket;
|
||||
}
|
||||
|
||||
public int getPasswordSetType() {
|
||||
return passwordSetType;
|
||||
}
|
||||
|
||||
public void setPasswordSetType(int passwordSetType) {
|
||||
this.passwordSetType = passwordSetType;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
@@ -23,6 +23,7 @@ package org.maxkey.authn.support.socialsignon;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.maxkey.authn.LoginCredential;
|
||||
import org.maxkey.authn.annotation.CurrentUser;
|
||||
import org.maxkey.authn.jwt.AuthJwt;
|
||||
import org.maxkey.authn.web.AuthorizationUtils;
|
||||
import org.maxkey.constants.ConstsLoginType;
|
||||
@@ -87,16 +88,15 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value={"/bind/{provider}"}, method = RequestMethod.POST)
|
||||
public ResponseEntity<?> bind(@PathVariable String provider) {
|
||||
@RequestMapping(value={"/bind/{provider}"}, method = RequestMethod.GET)
|
||||
public ResponseEntity<?> bind(@PathVariable String provider,@CurrentUser UserInfo userInfo) {
|
||||
//auth call back may exception
|
||||
try {
|
||||
String instId = WebContext.getInst().getId();
|
||||
SocialsAssociate socialsAssociate = this.authCallback(instId,provider);
|
||||
UserInfo userInfo = AuthorizationUtils.getUserInfo();
|
||||
SocialsAssociate socialsAssociate = this.authCallback(userInfo.getInstId(),provider);
|
||||
socialsAssociate.setSocialUserInfo(accountJsonString);
|
||||
socialsAssociate.setUserId(userInfo.getId());
|
||||
socialsAssociate.setUsername(userInfo.getUsername());
|
||||
socialsAssociate.setInstId(userInfo.getInstId());
|
||||
//socialsAssociate.setAccessToken(JsonUtils.object2Json(accessToken));
|
||||
//socialsAssociate.setExAttribute(JsonUtils.object2Json(accessToken.getResponseObject()));
|
||||
_logger.debug("Social Bind : "+socialsAssociate);
|
||||
|
||||
Reference in New Issue
Block a user