问题
The Azure MobileServiceClient in built authenticator shows a webview when trying to log in using an Android device. Is there a way such that it can be used to call the Play Services Login Dialog box and log in through there? I was following the tutorial given here.
回答1:
Yes, you can use a "Client Directed Flow", assuming the Google Play Services Login Dialog produces a standard Google token and you know the Client ID of the Google App.
1) Configure Azure Authentication / Authorization for Google
2) Configure your app to use the [Google Play Services Login Dialog] (https://developers.google.com/android/guides/google-services-plugin)
3) Obtain the Google token (from GoogleAuthUtil.getToken)
4) Use the google token to do a client-directed login using the Azure Mobile Apps Android SDK:
ListenableFuture<MobileServiceUser> mLogin = mClient.login(MobileServiceAuthenticationProvider.Google, theGoogleToken);
There should not be another dialog produced, but you will get the ZUMO-TOKEN back as described in the Server Flow
来源:https://stackoverflow.com/questions/35619777/android-azure-mobile-services-google-auth