You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnerrors.New("the OIDC.PassThroughAuthHeader setting must be used in conjunction with a JWT provider that is configured to read from a header")
928
928
}
929
+
930
+
// Envoy rejects (NACKs) an OAuth2 config whose pass_through_matcher keys on the
931
+
// forward_id_token header. EG builds the pass_through_matcher from
932
+
// the JWT providers' extractFrom headers (defaulting to "Authorization"), so
933
+
// reject the equivalent collision here to surface a clear policy error instead
934
+
// of a listener NACK.
935
+
ifoidc.ForwardIDToken!=nil {
936
+
fwdHeader:=oidc.ForwardIDToken.Header
937
+
for_, provider:=rangejwt.Providers {
938
+
// When ExtractFrom is not specified, JWT (and the pass-through matcher)
939
+
// falls back to the "Authorization" header.
940
+
ifprovider.ExtractFrom==nil {
941
+
ifstrings.EqualFold(fwdHeader, "Authorization") {
942
+
returnfmt.Errorf("the OIDC.ForwardIDToken header %q cannot be the Authorization header when passThroughAuthHeader is enabled and a JWT provider reads from it", fwdHeader)
943
+
}
944
+
continue
945
+
}
946
+
for_, h:=rangeprovider.ExtractFrom.Headers {
947
+
ifstrings.EqualFold(fwdHeader, h.Name) {
948
+
returnfmt.Errorf("the OIDC.ForwardIDToken header %q cannot be the same as a JWT provider extractFrom header when passThroughAuthHeader is enabled", fwdHeader)
0 commit comments