feat(token): support link_identity in the access_token grant#2614
Open
spydon wants to merge 1 commit into
Open
feat(token): support link_identity in the access_token grant#2614spydon wants to merge 1 commit into
spydon wants to merge 1 commit into
Conversation
5dc0147 to
1d3f849
Compare
a844510 to
44bc577
Compare
1d3f849 to
16f15c6
Compare
e3d5fbe to
1d63179
Compare
When link_identity is set and a valid user access token is provided in the Authorization header, link the provider identity to that user instead of signing in or creating a new account, mirroring the id_token grant.
16f15c6 to
39ea58a
Compare
1d63179 to
f709746
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Adds
link_identitysupport to theaccess_tokengrant, so an already-authenticated user can attach a provider identity (Facebook) to their existing account using a provider access token, instead of signing in or creating a new account.Why
Parity with the
id_tokengrant, which already supportslink_identity. This lets a user who signed in another way (email, another provider) connect their Facebook account when native login only yields a classic access token (the case #2609 exists for).How
Mirrors the
id_tokengrant exactly:link_identityis set, require a valid user access token in theAuthorizationheader (requireAuthentication), resolve the target user, and set it on the context.linkIdentityToUserinstead ofcreateAccountFromExternalIdentity.Tests
TestAccessTokenGrantLinkIdentity: links Facebook to an existing signed-in user, asserts the same user is returned and thefacebookidentity is attached.TestAccessTokenGrantLinkIdentityRequiresAuth: linking without anAuthorizationheader is rejected.Stacking
Stacked on #2609 (base branch
feat/facebook-access-token-grant). Review/merge that one first; this diff is only the linking addition.