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

Add RS256 support to OpenIDConnect #693

Closed
wants to merge 10 commits into from

Conversation

mvschaik
Copy link
Contributor

Previously the implementation of OpenIDConnect depended on statically provided keys. This worked when it could only do HMAC signature verification ("HS256"), but was not feasible for RSA based verification ("RS256"), since the keys should be fetched from the provider.

I added automatic configuration for OpenIDConnect to simplify creation of backends, and resolving of the keys. I had to switch to pyjwkest for signature verification, since pyjwt makes it really hard to do pass the keys.

PyJWT seems to be only used in Azure AD (which actually seems to be OpenIDConnect, so it might be simplified by just deriving from it and configuring the OIDC_ENDPOINT, I don't have an Azure account to test with though) and in ExactTarget. Maybe we can at some point remove the dependency in favor of PyJWKEST?

Together with #687 this PR fixes the issues with GoogleOpenIdConnectAuth, as described in #477 and #644.

mvschaik and others added 2 commits July 22, 2015 16:14
And use jwkest to decode signature, because it supports more than just HS256.
@mvschaik mvschaik changed the title Fix OpenIDConnect Add RS256 support to OpenIDConnect Jul 22, 2015
@mvschaik
Copy link
Contributor Author

Hi @omab,

What do you think of these PR's? Is this something you could accept? Please let me know if you have additional requirements or questions so I can address them!

Thanks!

cls.oidc_config = self.get_json(self.OIDC_ENDPOINT + '/.well-known/openid-configuration')
cls.ACCESS_TOKEN_URL = self.oidc_config['token_endpoint']
cls.AUTHORIZATION_URL = self.oidc_config['authorization_endpoint']
cls.REVOKE_TOKEN_URL = self.oidc_config['revocation_endpoint']
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line raised an exception for me because I don't have revocation_endpoint in my openid config.

The exception happens after cls.oidc_config has already been set. So the next time this won't get run and you won't get an exception, but you do end up with empty values for cls.USERINFO_URL and all other config defined below this line.

@mvschaik
Copy link
Contributor Author

mvschaik commented Sep 4, 2015

I overhauled the caching of OIDC configuration and keys, so now it is more robust.

@nickcatal
Copy link
Contributor

@mvschaik Since you have #747 can you close this? I didn't notice it. Will move my commit comments over there

@mvschaik
Copy link
Contributor Author

Closed in favor of #747

@mvschaik mvschaik closed this Sep 30, 2015
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

Successfully merging this pull request may close these issues.

4 participants