Browse Source

Merge branch 'develop' of gitadmin/tuoheng_oidc into release

tags/v2.3.0
gitadmin 2 years ago
parent
commit
cacc9602ef
2 changed files with 6 additions and 5 deletions
  1. +4
    -3
      tuoheng_oidc_server/src/main/java/com/tuoheng/config/IdTokenCustomizerConfig.java
  2. +2
    -2
      tuoheng_oidc_server/src/main/java/com/tuoheng/service/impl/OidcUserInfoServiceImpl.java

+ 4
- 3
tuoheng_oidc_server/src/main/java/com/tuoheng/config/IdTokenCustomizerConfig.java View File

@@ -1,5 +1,6 @@
package com.tuoheng.config;

import com.alibaba.fastjson.JSONObject;
import com.tuoheng.mapper.UserMapper;
import com.tuoheng.model.dto.UserBaseInfoDto;
import org.springframework.beans.factory.annotation.Autowired;
@@ -45,9 +46,9 @@ public class IdTokenCustomizerConfig {
.claims(claims ->
claims.put("username", context.getPrincipal().getName()))
.claims(claims ->
claims.put("oUserId", userBaseInfoDto.getUserId()));
/*.claims(claims ->
claims.put("clientRoleList", userBaseInfoDto.getClientRoleDtoList()));*/
claims.put("oUserId", userBaseInfoDto.getUserId()))
.claims(claims ->
claims.put("clientRoleList", JSONObject.toJSONString(userBaseInfoDto.getClientRoleDtoList())));
}
};
}

+ 2
- 2
tuoheng_oidc_server/src/main/java/com/tuoheng/service/impl/OidcUserInfoServiceImpl.java View File

@@ -31,8 +31,8 @@ public class OidcUserInfoServiceImpl implements OidcUserInfoService {
if (scopes.contains(OidcScopes.PROFILE)) {
builder.claim("userId", userBaseInfoDto.getUserId())
.claim("userName", userBaseInfoDto.getUserName())
.claim("authority", userBaseInfoDto.getAuthorityList());
//.claim("clientRoleList", userBaseInfoDto.getClientRoleDtoList().toString());
.claim("authority", userBaseInfoDto.getAuthorityList())
.claim("clientRoleList", userBaseInfoDto.getClientRoleDtoList());
}
/*if (scopes.contains(OidcScopes.EMAIL)) {
builder.email(name + "@163.com").emailVerified(true);

Loading…
Cancel
Save