How to implement Google Login in a WkWebView switching to SFSafariViewController

Viewed 2825

I have an iOS App that basically runs a mobile website using a WkWebView. In the mobile website users can sign in using a Google account.

Due to the fact that google will not allow WebViews to use Google Sign in anymore, how can i login my users?

I think of two solutions:

  1. Intercept the google login URL (account.google.com/) and open a SFSafariViewController and then somehow get the callback in my WkWebView?

    1. Intercept the google login URL and use a Google Sign in SDK which relays on the SFsafariViewController but will give me only an userToken which i would have to send to my website and authenticate the user in the server side.

Is there an easy way to authenticate the user without dealing with the tokens?

1 Answers
Related