We want create a QR code login Auth provider and the login process should be:
- User use 3rd party mobile app to scan the QR code (dynamically generated by 3rd party server) on our web page
- Our front end page will get a callback with 3rd party temp access code
- We send the temp access code to our server and our server will talk to 3rd party auth server to get user access token and user info (user id, email and etc)
- We will associate the 3rd party user with our user (matching email) and log the user in
We want to use Parse.User.LogInWith() or Parse.User.become() from JS SDK on our front end. But we were facing some technical pitfalls:
- 2-steps process for LogInWith(), we stuck at associating the 3rd party user with ours: we tried manually add authData for _User or using linkWith(), but they all return errors complaining: 206 cannot modify user xxxxxx.
- We also tried to manually create a fake sessionToken and send it back to front-end, so it can use Parse.User.become(). It looks like a success at the beginning, but having errors when accessing the data later.
Any idea on what is the right approach to do this?
Thanks!