Closed diegosperes closed 6 months ago
This is a good idea. A few considerations that come to mind -
GET /oauth/providers
would be needed to enumerate providers enabled for a session and enable the unlink from front end.GET /accounts/id
endpoint. A private endpoint to handle unlink by ID for administrative users might be valuable as well.@AlexCuse Thanks for your comments.
I've submitted a PR that implements the unlink feature, taking into account all your suggestions during development.
To address your queries:
Regarding whether we need to support any revocation with the provider(s) or if it's sufficient to just "forget" the user's OAuth account, my tests indicate that simply "forgetting" the user's OAuth account allows the user to reenter the OAuth flow without any issues.
As for the scenario where a user revokes access through the provider and how to handle re-linking in that case, this is already implemented. The user simply needs to give consent again to use social login.
Authn offers a feature that enables users to connect their accounts with their social media profiles. However, this has created a need for a feature that allows users to disconnect their social media accounts. The current issue is to develop a way in Authn that enables users to unlink social media account.
Proposed Solution:
Create a new HTTP DELETE endpoint to unlink the user's current session from their social media accounts. This endpoint will be public. The frontend needs to adhere to the following contract:
DELETE /oauth/provider
In that case provider can be one of the supported oauth providers like; google