-
-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Env vars for jwks_url in id_token mutator not working in versions >v0.19.0-beta.1 #276
Comments
This is probably a dupe of #270 right? |
I wouldn't say that it is a duplicate for two reasons:
|
While the symptoms are the different, the cause is the same, right? I think if we just add the new keys there this should be resolved right away. We should also document this in the upgrade guide then. Would you be up for that? |
As I said, I don't think that adding proper keys would be sufficient. The proper key for JWKS_URL I would rather suspect that it is related to the way how viper is loading env variables. If you set a value for the key manually (uncomment this line and remove config for jwks_url) the test is positive. One thing I was missing when looking to the code is where is the setting for viper, so for a key |
We did that because But you're right, |
I believe I have found the issue, BindEnv is not actually being called, causing viper to not observe those keys, hence, when trying to get the whole config, this fails. |
I will try to come up with a PR this week (however, we have an internal deadline for another project) and also a test to make sure this doesn't regress in the future. |
Describe the bug
Mutator
id_token
requiresjwks_url
to be configured either in global or in per-rule configuration. The global configuration in most cases can be set by env variables. As the version v0.19.0 introduced changes in config (#258) it is logical that also env variables might have been changed.Previously our configuration was setting
MUTATORS_ID_TOKEN_JWKS_URL
and it obviously didn't work in the recent oathkeeper version. I set it toMUTATORS_ID_TOKEN_CONFIG_JWKS_URL
as it is currently configured on master but it also didn't work.For both cases Oathkeeper returns error
when calling a service.
some thoughts on this issue: I suspect that it might be related to the way how config for mutators is validated. Maybe the validation with json schema happens on the config object without jwks_url set to value from env variable. I haven't checked it thoroughly in the code, though.
Reproducing the bug
Steps to reproduce the behavior:
MUTATORS_ID_TOKEN_CONFIG_JWKS_URL
set to the jwks location, and with id_token mutator in global config set as following:Server logs
Expected behavior
I expect the request to pass.
Environment
Additional context
The text was updated successfully, but these errors were encountered: