GoogleAuth Workflow used in ServiceStack API to be called on iOS

Is it possible to implement an iOS app calling a backend ServiceStack API with Google Authentication?

Is the workflow this?

  1. call auth/googleauth
  2. display returned response in web view
  3. check web view url change until it will be https://api.MYWEBSITE.COM
  4. obtain access token by calling session-to-token method
  5. use access token as usual
  6. List item

Actual problem is that I Google not allow to use web view for auth. I can use only browser. The problem is that I can’t do step 3 in such case, because I don’t have access to browser url information.

What is the best practice?

Look at the new Authentication via AccessToken added in the last release where you can use Google’s Native SDK to fetch a users AccessToken which you can use to Authenticate in ServiceStack with.

We’ve added documentation showing how to Sign In with Google OAuth in Android which you should be able to use the same approach for iOS.