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

Update the PyFxA verify_token() method to perform local verification of JWT access tokens using a third-party JWT library #79

Open
tublitzed opened this issue Apr 29, 2020 · 5 comments

Comments

@tublitzed
Copy link

To support the larger efforts to get the FxA Rust Component into Desktop, we first need to get Sync completely migrated away from BrowserID over to OAuth.

@fzzzy
Copy link
Contributor

fzzzy commented May 13, 2020

To do this, I will be porting the javascript implementation to the existing python implementation (which will then get ported to rust later. lol.)

https://github.com/mozilla/fxa/blob/master/packages/fxa-auth-server/lib/oauth/token.js

@rfk
Copy link
Contributor

rfk commented May 13, 2020

I think the more interesting piece from your perspective will be https://github.com/mozilla/fxa/blob/493c1cc96cd23e9b4c5e9355db40c32b6fe9785b/packages/fxa-auth-server/lib/oauth/jwt_access_token.js#L104

(Which actually isn't very interesting apart from checking the typ parameter).

You will also need to discover the FxA server's public key, by loading it from https://accounts.firefox.com/.well-known/openid-configuration via the jwks_uri field.

@fzzzy
Copy link
Contributor

fzzzy commented May 18, 2020

@rfk Great, thanks for the details.

@rfk
Copy link
Contributor

rfk commented May 22, 2020

From slack conversation, I filed an issue to make sure we're all on the same page about cachine behavior when fetching the keys: mozilla/fxa#5411

I also figured I'd drop a link to the FxA doc on how to verify the JWTs, for completeness: https://github.com/mozilla/fxa/blob/master/packages/fxa-auth-server/docs/oauth/jwt-access-tokens.md#local-verification-of-a-jwt-access-token

@rfk
Copy link
Contributor

rfk commented May 22, 2020

See also mozilla/fxa#5412 for a suggestion to make discovery of the keys slightly easier given the current shape of the PyFxA codebase.

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