I want to bring the discussion that started in our teams and get your opinion about it.
Assume we have an user account which could have different credentials for authentication and associated email to recover. An user has possibility to do signup with an email or use his social profile to complete signup process.
As an Rest API from the backend to client looks like:
- Create account
- Authorise
- Update user data
- Link social account
- Register email
- Verify email
In addition our BE is distributed and divided between several services/servers/clusters. So different calls are related to different end points. As well we have different client - mobile native applications, web application.
The usual registration flow looks for the client like this:
- Ask user for email
- Create account (Rest)
- Authorise (Rest)
- Ask user for his display name
- Update data (Rest)
- Register email (Rest)
And future possible calls:
- Verify email
- Link social account to user
With the Facebook signup:
- Ask user to login to FB
- Create account (Rest)
- Authorise (Rest)
- Link FB (Rest)
- Register and verify FB user email (Rest)
- Update user name based on FB data (Rest)
But all these steps are possible to do on backend. So we proposed to have another end point which will hide/combine different calls on BE and return whole process result to the clients:
- Ask user for FB login
- New user with FB (proposed Rest)
- BE is doing register/link verified email/update user data/authorise
The pros for this approach:
- No more duplication of functionality between clients
- Speed up the networking and user experience
The cons for this approach:
- Additional work for backend
- Probably most complex scenarios in future updates
I would like to get your opinion or experience with this situation. Especially if you already experienced point "Probably most complex scenarios in future updates" from against reasons.