我在我的android應用程序中使用Azure移動服務,通過Facebook和Google嚮應用程序添加身份驗證。但是,每次嘗試從應用程序登錄時,我收到以下錯誤:Azure Movile Services:Provider not enabled
"com.microsoft.windowsazure.mobileservices.MobileServiceException: Logging >in with the selected authentication provider is not enabled".
沒有發生其他錯誤。這是我的代碼:
private void authenticate(boolean bRefreshCache)
throws ClientProtocolException, IOException {
bAuthenticating = true;
if (bRefreshCache || !loadUserTokenCache(mClient)) {
mClient.login(MobileServiceAuthenticationProvider.Facebook,
new UserAuthenticationCallback() {
@Override
public void onCompleted(MobileServiceUser user,
Exception exception,
ServiceFilterResponse response) {
synchronized (mAuthenticationLock) {
if (exception == null) {
cacheUserToken(mClient.getCurrentUser());
Log.i("MappingRoadConditions",
"authenticating");
createAndShowDialog(String.format(
"You are now logged in - %1$2s",
user.getUserId()), "Success");
} else {
createAndShowDialog(exception.getMessage(),
"Login Error");
}
bAuthenticating = false;
mAuthenticationLock.notifyAll();
}
}
});
} else {
// Other threads may be blocked waiting to be notified when
// authentication is complete.
synchronized (mAuthenticationLock) {
bAuthenticating = false;
mAuthenticationLock.notifyAll();
}
}
}
由Google登錄的功能是完全相同的,除了當然提供商的名稱。
1)我已經嘗試通過瀏覽器登錄進行故障排除,我可以很好地登錄使用Facebook和谷歌。 2)我已經在清單文件中添加了互聯網權限。 3)我也嘗試通過更改互聯網連接來測試應用程序,以防萬一它是網絡連接問題,但無濟於事。我可以通過同一互聯網上的瀏覽器完美登錄。
關於可能發生什麼的任何想法?
您是否向提供商註冊過應用程序?您是否在門戶的「標識」選項卡中輸入了提供程序設置? – CSharpRocks
當然。這就是爲什麼它在瀏覽器中工作的原因。任何其他想法? :( – user2831859
你可以顯示你的代碼嗎? – CSharpRocks