Skip to content

Commit 390ada8

Browse files
committed
Improve logging
1 parent 91fbe00 commit 390ada8

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

gateway/mw_jwt.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -897,8 +897,10 @@ func (k *JWTMiddleware) processCentralisedJWT(r *http.Request, token *jwt.Token)
897897
}
898898

899899
oauthClientID := ""
900-
// Get the OAuth client ID if available:
900+
// Get the OAuth client ID if available.
901+
// This step is skipped for external IDPs if IDPClientIDMappingDisabled is set to true.
901902
if !k.Spec.IDPClientIDMappingDisabled {
903+
k.Logger().Debug("IDP client ID mapping enabled, attempting to retrieve OAuth client ID from claims.")
902904
oauthClientID = k.getOAuthClientIDFromClaim(claims)
903905
}
904906

@@ -944,7 +946,8 @@ func (k *JWTMiddleware) processCentralisedJWT(r *http.Request, token *jwt.Token)
944946
}
945947
}
946948
} else {
947-
k.Logger().WithError(err).Debug("Couldn't get OAuth client")
949+
k.Logger().WithError(err).
950+
Warnf("Failed to retrieve OAuth client. For external IDPs, consider disabling IDP client ID mapping for better performance.")
948951
}
949952
}
950953

0 commit comments

Comments
 (0)