mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-29 20:18:05 +01:00
fix #10913: initialize provider before calling Load
Signed-off-by: Thomas Rosenstein <thomas.rosenstein@creamfinance.com>
This commit is contained in:
parent
b9bb47ca80
commit
874b0b1c0c
@ -241,6 +241,11 @@ func refreshToken(ctx context.Context, token *Token) (*Token, error) {
|
|||||||
// UserInfoFromToken tries to call the UserInfo endpoint of the OIDC provider, and consolidate with ID token
|
// UserInfoFromToken tries to call the UserInfo endpoint of the OIDC provider, and consolidate with ID token
|
||||||
// to generate a UserInfo object, if the ID token is not in the input token struct, some attributes will be empty
|
// to generate a UserInfo object, if the ID token is not in the input token struct, some attributes will be empty
|
||||||
func UserInfoFromToken(ctx context.Context, token *Token) (*UserInfo, error) {
|
func UserInfoFromToken(ctx context.Context, token *Token) (*UserInfo, error) {
|
||||||
|
// #10913: preload the configuration, in case it was not previously loaded by the UI
|
||||||
|
_, err := provider.get()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
setting := provider.setting.Load().(models.OIDCSetting)
|
setting := provider.setting.Load().(models.OIDCSetting)
|
||||||
local, err := userInfoFromIDToken(ctx, token, setting)
|
local, err := userInfoFromIDToken(ctx, token, setting)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user