Oauth unlink social accounts#253
Conversation
7f6cee1 to
ab77e1c
Compare
cainlevy
left a comment
There was a problem hiding this comment.
Thanks for working on this! I'm sorry for the delay in reviewing.
…ic GET oauth/info endpoint, and private DELETE /account/{id}/oauth endpoint
…count from an user that does not exists.
ea18267 to
bbce75d
Compare
AlexCuse
left a comment
There was a problem hiding this comment.
This is looking really good think this is my last round of comments.
| @@ -0,0 +1,62 @@ | |||
| package services_test | |||
|
@cainlevy do you think we need to worry about revoking the stored access token here or is it sufficient to "forget"? Looking at apple's implementation it would be fairly simple, though it does require an additional URL to be defined https://developer.apple.com/documentation/sign_in_with_apple/revoke_tokens/ A quick search on google and microsoft seems to indicate the tokens expire after an hour anyway so may be nothing to worry about there. |
3c081af to
e20e128
Compare
e20e128 to
5277772
Compare
cainlevy
left a comment
There was a problem hiding this comment.
thank you! it's looking good.
Personally I would expect it's enough to forget them. Revoking them sounds very thorough but also would require a higher level of integration with each identity provider. |
Where the discussion started. Authn issue.
Summary
This PR is adding the ability of share oauth account information and delete them.
Changes
emailcolumn tooauth_accountstable in order to facilitate users identify their accounts.GET /account/{id}to returnoauth_providerscontaining OAuth information.DELETE /oauth/{provider}allowing user unlink OAuth accounts.GET /oauth/inforeturning oauth information for linked accounts.DELETE /account/{id}/oauthallowing unlink OAuth accounts for the given user.There's a particular use case that requires special attention. When a user registers via the OAuth flow, a random password is generated. To unlink the social account, Authn verifies whether the user needs to set a new password. As a side effect, a new error, NEW_PASSWORD_REQUIRED, has been introduced.