Skip to content

Commit 1cfe7b3

Browse files
committed
fix: return 500 internal server errors on miss configuration during token exchange
1 parent 20e8067 commit 1cfe7b3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

web/auth/token_exchange.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ func validateTokenExchangeIDToken(inst *instance.Instance, raw string) (jwt.MapC
8888

8989
expectedIssuer, err := oidcprovider.GetIssuer(inst.ContextName, conf)
9090
if err != nil {
91-
return nil, errors.New("invalid token")
91+
inst.Logger().WithNamespace("token_exchange").Errorf("Cannot get OIDC issuer for context %s: %s", inst.ContextName, err)
92+
return nil, echo.NewHTTPError(http.StatusInternalServerError, "internal server error")
9293
}
9394
issuer, err := claims.GetIssuer()
9495
if err != nil || issuer == "" || issuer != expectedIssuer {

0 commit comments

Comments
 (0)