Faced such a problem: when users from a smartphone(at least an android) try to enter the site through a social network, clicking on the login link captures the native FB or VK application(though not all and not all browsers), the social network confirms the entrance, but the frontend cannot process the data.

I have a SPA that communicates with the backend via rest-api, stateless.Logging in via the social network is organized through the backend: the user opens a new window, there he confirms the entry, redirects to my service page, where I confirm the entry and give it to json api-key and user information.The frontend picks it up and closes the window.
Everything worked fine, while it worked through the browser.When the request intercepts the native social network application, then after the request is confirmed, the user sees my service page, but the frontend does not see it, because it is open in the social network application, and not in the browser.

What to do with it - I don’t understand yet.
Who faced this? Or what are the more competent ways to organize login through a social network?
  • Use authorization on the front, bypassing the back. – Ugly Unicorn Aug 21 '19 at 22:14
  • Ugly Unicorn, then I have to completely trust the data that came from the client.I don’t like this. – Bad68 Aug 21 '19 at 23:13

1 Answers 1

As an example, https://developers.facebook.com/docs/facebook-logi...
  • I still do not understand how this will help me.This is the same input for native applications... – Bad68 Aug 21 '19 at 23:14
  • [[zIs]], Ah, I thought you were writing an application on js. – Ugly Unicorn Aug 22 '19 at 00:45