diff --git a/src/backend/auth/biz-auth/src/main/kotlin/com/tencent/bkrepo/auth/model/TOauthToken.kt b/src/backend/auth/biz-auth/src/main/kotlin/com/tencent/bkrepo/auth/model/TOauthToken.kt index 87f3a502c3..fe7ab7723b 100644 --- a/src/backend/auth/biz-auth/src/main/kotlin/com/tencent/bkrepo/auth/model/TOauthToken.kt +++ b/src/backend/auth/biz-auth/src/main/kotlin/com/tencent/bkrepo/auth/model/TOauthToken.kt @@ -40,7 +40,7 @@ data class TOauthToken( val expireSeconds: Long?, val type: String, val accountId: String, - val userId: String, + var userId: String, var scope: Set?, var issuedAt: Instant, var idToken: IdToken? diff --git a/src/backend/auth/biz-auth/src/main/kotlin/com/tencent/bkrepo/auth/service/oauth/OauthAuthorizationServiceImpl.kt b/src/backend/auth/biz-auth/src/main/kotlin/com/tencent/bkrepo/auth/service/oauth/OauthAuthorizationServiceImpl.kt index 033bdcbba6..fcf1bc3fdf 100644 --- a/src/backend/auth/biz-auth/src/main/kotlin/com/tencent/bkrepo/auth/service/oauth/OauthAuthorizationServiceImpl.kt +++ b/src/backend/auth/biz-auth/src/main/kotlin/com/tencent/bkrepo/auth/service/oauth/OauthAuthorizationServiceImpl.kt @@ -218,6 +218,7 @@ class OauthAuthorizationServiceImpl( if (client.scope != tOauthToken.scope) { tOauthToken.scope = client.scope!! } + tOauthToken.userId = userId tOauthToken.accessToken = idToken.toJwtToken() tOauthToken.idToken = if (openId) idToken else null tOauthToken.issuedAt = Instant.now(Clock.systemDefaultZone())