Is it possible to implement an iOS app calling a backend ServiceStack API with Google Authentication?
Is the workflow this?
- call auth/googleauth
- display returned response in web view
- check web view url change until it will be https://api.MYWEBSITE.COM
- obtain access token by calling session-to-token method
- use access token as usual
- 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.