Skip to content
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

OIDC support: hardcoded presumption that is only valid for Authentik #1377

Closed
dataway opened this issue Dec 23, 2024 · 5 comments
Closed

OIDC support: hardcoded presumption that is only valid for Authentik #1377

dataway opened this issue Dec 23, 2024 · 5 comments
Assignees

Comments

@dataway
Copy link
Contributor

dataway commented Dec 23, 2024

jwks_url = f"{OIDC_SERVER_APPLICATION_URL}/jwks/"

The OIDC functionality assumes that the JWKS URL is "{OIDC_SERVER_APPLICATION_URL}/jwks/"

This is incorrect behaviour - the JWKS URL can be anywhere. It should be configurable, or - better - be autodiscovered using OpenID Connect Discovery.

@adamantike
Copy link
Contributor

@dataway, thanks for reporting this incorrect behavior.

Is this something you would be able to work on?

@gantoine
Copy link
Member

I should be able to tackle this, since we already fetch from well-known/openid-configuration we can use that to get the jwks_uri in most cases.

@gantoine gantoine self-assigned this Dec 23, 2024
@dataway
Copy link
Contributor Author

dataway commented Dec 23, 2024

@dataway, thanks for reporting this incorrect behavior.

Is this something you would be able to work on?

I could have a look but I'm not at all familiar with the code.

I will however be happy to test. I currently have Authentik, Keycloak and Zitadel running in my homelab.

@dataway
Copy link
Contributor Author

dataway commented Dec 23, 2024

Now I get a new error, but I think I know what the issue is and will try to fix it

INFO:      [RomM][base_handler][2024-12-23 16:00:31] Fetching JWKS from https://*****/oauth/v2/keys
    |     cls.validate_dict_key(value)
    |   File "/src/.venv/lib/python3.12/site-packages/joserfc/rfc7517/models.py", line 239, in validate_dict_key
    |     cls.binding.validate_dict_key_registry(data, cls.param_registry)
    |   File "/src/.venv/lib/python3.12/site-packages/joserfc/rfc7517/models.py", line 64, in validate_dict_key_registry
    |     raise ValueError(f'"{k}" {error}')
    | ValueError: "use" must be one of ['sig', 'enc']
    +------------------------------------

@gantoine
Copy link
Member

@dataway going to close this as it should work now, but if you find a fix for your issue can you open a PR for it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants