Android Azure Mobile Services Google auth

荒凉一梦 提交于 2020-01-04 11:04:05

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!