The Kubernetes documentation related to OpenID Connect mentions that as part of setting things up you need to supply some parameters to the API server:
--oidc-client-id: A client id that all tokens must be issued for.
There is no other explanation about how this would map to, say, something returned by the OpenID Connect-conformant Google identity provider.
I don't know what this parameter value will be used for. Will it match against something in the decoded JWT token?
It looks like the id_token returned by the Google identity provider might contain something, once decoded, in its aud field (aud is apparently short for "audience"). Is this what the --oidc-client-id should match? Am I way off?
This can be explained from the kubernetes documentation on id tokens.
As you can see, identity provider is a separate system. For example this can be MS Azure AD or Google as you have shown.
When you register for a identity provider, you get important things in return.
client idis one such important parameter. if you are aware of the openid connect flow, you need to provide thisclient idwhen you follow the flow. If the flow is complete, you will return anid token. Anid tokenhas one must have claim,audwhich is the audience that token was issued for.When you validate an
id tokenyou MUST verify you are in the audience list. More can be found from the spec.Quoting from specification,
Now, kubernetes uses bearer tokens. Here the tokens used are
id tokens. To validate the token it should know specifically the audience. This enables the API server to validate the token is issued for the particular client who made the call. Thus authorising the call to to success.