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

Verification of incoming token #49

Open
marcesengel opened this issue Jul 15, 2023 · 4 comments
Open

Verification of incoming token #49

marcesengel opened this issue Jul 15, 2023 · 4 comments

Comments

@marcesengel
Copy link

Hi,

first of all thanks a lot for the work on this package! Looking through the README, I was wondering if jwt.decode(idToken) is actually the right thing to do, or if it'd make sense to also verify the incoming token?
For now I'm verifying them, is this redundant? I'm not aware of the exact auth flow. Thanks in advance!

Best regards

@ananay
Copy link
Owner

ananay commented Jul 15, 2023

Verification is great - and in fact recommended. I feel this should be part of the repo itself where it does that step just to ensure its not a replay attack or the token hasn't been tampered with.
https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_rest_api/verifying_a_user

@marcesengel
Copy link
Author

@ananay thanks for the response! I've actually implemented getting the public keys from the api endpoint, caching them etc. - would you like me to share a gist so you might be able to copy & paste it?

I'd suggest to say so in the docs instead of suggesting jwt.decode(...), what do you think? 🤔

@ananay
Copy link
Owner

ananay commented Jul 19, 2023

@marcesengel Thanks! Please feel free to share a gist or make a pull request with the code added! :D

@marcesengel
Copy link
Author

@ananay sorry for the delay, I've prepared a gist: https://gist.github.com/marcesengel/f14ea18b850d87e89b2a51e6d74b29b6

Feel free to reach out if you'd like to discuss anything, maybe in the comments of the gist?

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

2 participants