I had oauth2-proxy running on my Kubernetes cluster which I deployed using Helm via ArtifactHUB > Helm > OAuth2 Proxy chart. I just upgraded oauth2-proxy from v7.1.3 to v7.4.0 with its chart from 4.2.2 to 6.16.1 and started seeing the following error:
[main.go:60] ERROR: Failed to initialise OAuth2 Proxy: error intiailising provider: could not create provider data: error building OIDC ProviderVerifier: invalid provider verifier options: missing required setting: issuer-url
What is the issue. How to fix it?
This error is coming on oauth2-proxy v7.4.0 using default values when configured with Azure AD. It should work without any errors as the desired behavior.
I referred to OAuth2 Proxy > Docs > Azure Auth Provider from documentation to make it work by adding
azure_tenantandoidc_issuer_urlunderconfigin the default values file as follows:Before:
After:
If it still fails after this change with the following error:
Error redeeming code during OAuth2 callback: unable to get email and/or groups claims from token: unable to get claims from token: could not initialise claim extractor: failed to parse ID Token: oidc: malformed jwt, expected 3 parts got 1then set the
oidc_issuer_urlunderconfigin the default values file to V2 Azure Auth endpoint instead as follows:NOTE: When using the Azure Auth provider with nginx and the cookie session store, you may find the cookie is too large and doesn't get passed through correctly. Increasing the
proxy_buffer_sizein nginx or implementing the Redis session storage should resolve this.NOTE:
${azure_tenant_id}will be replaced with the actual Azure App Tenant ID which you can find here: Azure Active Directory (AD) > App registrations > All applications >[APP NAME]> Overview > Essentials >Directory (tenant) IDwhere[APP NAME]is the name of the registered app for oauth2-proxy.