Bluemix:bms-samples-android-helloauthentication错误

时间:2016-02-25 09:41:23

标签: ibm-cloud google-authentication ibm-mobile-services

我正在尝试为基于Google的授权运行示例BMS应用

https://github.com/ibm-bluemix-mobile-services/bms-samples-android-helloauthentication

在build.gradle中将targetSdkVersion更改为22后,它在Android Studio模拟器上运行(我有java.lang.SecurityException:更改前缺少android.permission.GET_ACCOUNTS)

按下“Ping Bluemix”按钮后,我的物理设备上出现以下错误:

02-25 12:32:49.446 30033-31086/com.ibm.helloauthentication E/mfpsdk.AuthorizationProcessManager: AuthorizationProcessManager.handleAuthorizationFailure in AuthorizationProcessManager.java:426 :: authorization process failed
02-25 12:32:49.446 30033-31096/com.ibm.helloauthentication W/System.err:     at com.android.org.conscrypt.OpenSSLX509Certificate.checkValidity(OpenSSLX509Certificate.java:216)
02-25 12:32:49.446 30033-31096/com.ibm.helloauthentication W/System.err:     at com.ibm.mobilefirstplatform.clientsdk.android.security.internal.certificate.CertificatesUtility.checkValidityWithPublicKey(CertificatesUtility.java:59)
02-25 12:32:49.446 30033-31096/com.ibm.helloauthentication W/System.err:     at com.ibm.mobilefirstplatform.clientsdk.android.security.internal.AuthorizationProcessManager.saveCertificateFromResponse(AuthorizationProcessManager.java:214)
02-25 12:32:49.446 30033-31096/com.ibm.helloauthentication W/System.err:    ... 12 more
02-25 12:32:49.451 30033-31096/com.ibm.helloauthentication E/MainActivity: Get request to Bluemix failed: THROWNjava.lang.RuntimeException: Failed to save certificate from response
02-25 12:32:49.451 30033-31096/com.ibm.helloauthentication E/MainActivity:     at com.ibm.mobilefirstplatform.clientsdk.android.security.internal.AuthorizationProcessManager.saveCertificateFromResponse(AuthorizationProcessManager.java:222)
02-25 12:32:49.451 30033-31096/com.ibm.helloauthentication E/MainActivity:     at com.ibm.mobilefirstplatform.clientsdk.android.security.internal.AuthorizationProcessManager.access$100(AuthorizationProcessManager.java:51)
02-25 12:32:49.451 30033-31096/com.ibm.helloauthentication E/MainActivity:     at com.ibm.mobilefirstplatform.clientsdk.android.security.internal.AuthorizationProcessManager$1.handleAuthorizationSuccessResponse(AuthorizationProcessManager.java:133)
02-25 12:32:49.451 30033-31096/com.ibm.helloauthentication E/MainActivity:     at com.ibm.mobilefirstplatform.clientsdk.android.security.internal.AuthorizationProcessManager$InnerAuthorizationResponseListener.onSuccess(AuthorizationProcessManager.java:469)
02-25 12:32:49.451 30033-31096/com.ibm.helloauthentication E/MainActivity:     at com.ibm.mobilefirstplatform.clientsdk.android.security.internal.AuthorizationRequestAgent.processResponse(AuthorizationRequestAgent.java:388)
02-25 12:32:49.451 30033-31096/com.ibm.helloauthentication E/MainActivity:     at com.ibm.mobilefirstplatform.clientsdk.android.security.internal.AuthorizationRequestAgent.processResponseWrapper(AuthorizationRequestAgent.java:542)
02-25 12:32:49.451 30033-31096/com.ibm.helloauthentication E/MainActivity:     at com.ibm.mobilefirstplatform.clientsdk.android.security.internal.AuthorizationRequestAgent.onSuccess(AuthorizationRequestAgent.java:513)
02-25 12:32:49.451 30033-31096/com.ibm.helloauthentication E/MainActivity:     at com.ibm.mobilefirstplatform.clientsdk.android.core.api.internal.BaseRequest$1.onResponse(BaseRequest.java:419)
02-25 12:32:49.451 30033-31096/com.ibm.helloauthentication E/MainActivity:     at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:170)
02-25 12:32:49.451 30033-31096/com.ibm.helloauthentication E/MainActivity:     at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33)

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

更新了该示例以使用正确的权限处理,因此您应该能够在SDK 23+上运行它,假设您在提示时授予权限。

我仍然无法在物理设备上重新创建您的特定问题,但是对于此类故障,我建议首先验证是否已缓存错误的标头(通过卸载并重新安装应用程序来解决)并且应该失败我建议从Bluemix中删除证书并重新添加它以重置与之关联的权限和授权。