mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 04:05:40 +01:00
Merge pull request #15242 from kschu91/bugfix/15241
Fix refreshing oidc access token breaks users subiss in database
This commit is contained in:
commit
3e983b1747
@ -55,7 +55,7 @@ func (md *metaDAO) DeleteByUserID(ctx context.Context, uid int) error {
|
||||
}
|
||||
|
||||
func (md *metaDAO) GetByUsername(ctx context.Context, username string) (*models.OIDCUser, error) {
|
||||
sql := `SELECT oidc_user.id, oidc_user.user_id, oidc_user.secret, oidc_user.token,
|
||||
sql := `SELECT oidc_user.id, oidc_user.user_id, oidc_user.secret, oidc_user.subiss, oidc_user.token,
|
||||
oidc_user.creation_time, oidc_user.update_time FROM oidc_user
|
||||
JOIN harbor_user ON oidc_user.user_id = harbor_user.user_id
|
||||
WHERE harbor_user.username = ?`
|
||||
|
@ -74,6 +74,7 @@ func (suite *MetaDaoTestSuite) TestGetByUsername() {
|
||||
ou, err := suite.dao.GetByUsername(ctx, suite.username)
|
||||
suite.Nil(err)
|
||||
suite.Equal(suite.userID, ou.UserID)
|
||||
suite.Equal("ca4bb144-4b5c-4d1b-9469-69cb3768af8fhttps://sso.andrea.muellerpublic.de/auth/realms/harbor", ou.SubIss)
|
||||
suite.Equal("xxxx", ou.Token)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user