Improve token construction logic and change key getter to public #35
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks for this package; Apple is pretty frustrating in that they kinda look like OAuth but their implementation is, well, wacky!
I am in a situation where I am doing both native app sign-in with Apple (because it's required...) as well as supporting sign-in with Apple on the web. Because their implementation looks like OpenID Connect but they don't support a user info endpoint, I'm passing the web back-end the ID token (a JWS) and using that to extract out the user's identity. This is done via a token exchange grant.
Anyway, I needed a way to construct an access token object using the ID token, and found that 1) the docblock on the constructor didn't reflect the true data requirements of the method and 2) it would be helpful to be able to fetch the Apple JWK set outside of the provider.
This PR addresses both points, which I think help make this package more syntactically correct and useful.
Admittedly this is a bit of a drive-by contribution but if this looks good in spirit, I can make whatever adjustments you'd like, e.g. test coverage. I'm not quite sure this requires new coverage?