k8s-auth-example
k8s-auth-example copied to clipboard
Make "Aud" an array to support "cross-client trust" - scenario
The code works in your scenario, but "in the general case, the aud value is an array of case sensitive strings." (https://openid.net/specs/openid-connect-core-1_0.html#IDToken)
If one specifies "cross-client trust" (https://github.com/dexidp/dex/blob/master/Documentation/custom-scopes-claims-clients.md#cross-client-trust-and-authorized-party - I think the example in the Dex-Doc where the "ID token claims" are shown is not correct any more), an array is returned for "Aud" (due to https://github.com/dexidp/dex/pull/1088).
To support both possible "aud"-variants, single string and string array, we have to use interface{} and decide on the concrete response-value via type assert if needed.