Android Azure移动服务Google身份验证

时间:2016-02-25 06:17:36

标签: android azure authentication azure-mobile-services

构建的身份验证器中的Azure MobileServiceClient在尝试使用Android设备登录时显示webview。有没有办法可以用它来调用Play服务登录对话框并通过那里登录?我正在按照here给出的教程。

1 个答案:

答案 0 :(得分:5)

是的,您可以使用“客户端定向流程”,假设Google Play服务登录对话框生成标准Google令牌,并且您知道Google App的客户端ID。

1)Configure Azure Authentication / Authorization for Google

2)配置您的应用以使用[Google Play服务登录对话](https://developers.google.com/android/guides/google-services-plugin

3)获取Google令牌(来自GoogleAuthUtil.getToken)

4)使用google令牌使用Azure移动应用Android SDK执行客户端定向登录:

ListenableFuture<MobileServiceUser> mLogin = mClient.login(MobileServiceAuthenticationProvider.Google, theGoogleToken);

不应该生成另一个对话框,但您将按照Server Flow

中的说明返回ZUMO-TOKEN