Merge pull request #186 from mstg/fix-lookaside

Fix authentication for machine clients
This commit is contained in:
resf-prow[bot] 2024-04-25 14:46:39 +00:00 committed by GitHub
commit 65b877b7e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -92,7 +92,7 @@ func checkAuth(ctx context.Context, hydraSDK *client.APIClient, hydraAdmin *clie
if err != nil {
return ctx, err
}
if *userInfo.Sub == "" && hydraAdmin != nil {
if userInfo.GetSub() == "" && hydraAdmin != nil {
introspect, _, err := hydraAdmin.OAuth2API.IntrospectOAuth2Token(ctx).Token(authToken[1]).Execute()
if err != nil {
logrus.Errorf("error introspecting token: %s", err)
@ -104,7 +104,7 @@ func checkAuth(ctx context.Context, hydraSDK *client.APIClient, hydraAdmin *clie
newEmail := fmt.Sprintf("%s@%s", *introspect.Sub, "serviceaccount.resf.org")
userInfo.Email = &newEmail
}
if *userInfo.Sub == "" {
if userInfo.GetSub() == "" {
return ctx, status.Errorf(codes.Unauthenticated, "invalid authorization token")
}