We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在WeiXinIdentityProvider类中的extractIdentityFromProfile方法中,尝试将微信用户的头图属性映射到Keycloak用户的属性,代码如下
@Override protected BrokeredIdentityContext extractIdentityFromProfile(EventBuilder event, JsonNode profile) { String uuionid = getJsonProperty(profile, "unionid"); BrokeredIdentityContext user = new BrokeredIdentityContext( (uuionid != null && uuionid.length() > 0 ? uuionid : getJsonProperty(profile, "openid"))); String nickname = getJsonProperty(profile, "nickname"); user.setUsername(getJsonProperty(profile, "openid")); user.setBrokerUserId(getJsonProperty(profile, "openid")); user.setModelUsername(nickname); user.setFirstName(nickname); user.setLastName(nickname); user.setEmail(nickname + "@qq.com"); user.setUserAttribute("avatar_url", getJsonProperty(profile, "headimgurl")); user.setName(getJsonProperty(profile, "nickname")); user.setIdpConfig(getConfig()); user.setIdp(this); AbstractJsonUserAttributeMapper.storeUserProfileForMapper(user, profile, getConfig().getAlias()); return user; }
打包插件代码,重启Keylcoak容器,在浏览器使用微信扫码登录后,NickName、FirstName、LastName以及Email均按代码规则设置,但头图属性并未添加到Keycloak的用户的Attribute中,如下
The text was updated successfully, but these errors were encountered:
Jeff-Tian
No branches or pull requests
描述
在WeiXinIdentityProvider类中的extractIdentityFromProfile方法中,尝试将微信用户的头图属性映射到Keycloak用户的属性,代码如下
打包插件代码,重启Keylcoak容器,在浏览器使用微信扫码登录后,NickName、FirstName、LastName以及Email均按代码规则设置,但头图属性并未添加到Keycloak的用户的Attribute中,如下
The text was updated successfully, but these errors were encountered: