ibm-bluemix-mobile-services/bms-clientsdk-cordova-plugin-core

Got error - com.google.android.gms.auth.UserRecoverableAuthException: NeedPermission

Closed this issue · 9 comments

08-26 00:16:10.340 28081-28081/com.ionicframework.inspectorapp430070 W/CordovaInterfaceImpl: Got an activity result, but no plugin was registered to receive it.
08-26 00:16:11.569 28081-31117/com.ionicframework.inspectorapp430070 W/GoogleAuthUtil: isUserRecoverableError status: NEED_PERMISSION
08-26 00:16:11.574 28081-29684/com.ionicframework.inspectorapp430070 E/DefaultGoogleAuthenticationListener: DefaultGoogleAuthenticationListener$RetrieveTokenTask.doInBackground in DefaultGoogleAuthenticationListener.java:170 :: Error getting google token: NeedPermission
08-26 00:16:11.577 28081-29684/com.ionicframework.inspectorapp430070 E/mfpsdk.AuthorizationRequestAgent: AuthorizationRequestAgent.requestFailed in AuthorizationRequestAgent.java:490 :: BaseRequest failed with info: {"errorCode":"101","msg":"GoogleAuth - Token returned null, canont login"}
08-26 00:16:11.580 28081-29684/com.ionicframework.inspectorapp430070 E/mfpsdk.AuthorizationProcessManager: AuthorizationProcessManager.handleAuthorizationFailure in AuthorizationProcessManager.java:443 :: authorization process failed
08-26 00:16:11.582 28081-29684/com.ionicframework.inspectorapp430070 E/mfpsdk.CDVMFPRequest: CDVMFPRequest$1$1.onFailure in CDVMFPRequest.java:80 :: Failed to send request.

Please make sure that you correctly initialize BMSClient with clientId or tenantId obtained from MCA credentials. Do not use appGuid copied from the Mobile Options App GUID field. This is applied to newly created MCA service instances. Also note, that an old MCA service instance (instance created before Aug 24) can't be unbound and then bound again to any application. The instance should be recreated and reconfigured again. Please let us know how it helps.

I have created MCA service instance newly by today morning only. Also I have configured the BMSClient and its credentials correctly as per the given document.

Even the given code is not supported com.ibm.mobilefirstplatform.clientsdk.android : 2+

Can you try to clear the gradle cache and ensure that you're getting the latest versions of all SDKs?

import com.ibm.mobilefirstplatform.clientsdk.android.security.api.AuthenticationContext;
package used in "bms-clientsdk-cordova-plugin-core/src/android/CDVBMSClient.java" is not supported in Android core sdk 2.+

While using sdk version 2+, need to do lot of changes in all java files under SRC.

I hope, the java files are not updated, sorry if I am mentioned anything wrongly.

one more query, if possible to implement both facebook and google authentication logic based on user preference, in the single application.

Hi,
You probably configured the gradle to import 'googleauthentication' version 2, this version is currently not supported in the Cordova core SDK, please work with version 1, i.e:

compile group: 'com.ibm.mobilefirstplatform.clientsdk.android',
            name:'googleauthentication',
            version: '1.+',
            ext: 'aar',
            transitive: true 

Regarding:
"...if possible to implement both facebook and google authentication logic based on user preference, in the single application."
Currently multiple identity providers are not supported.

BMSCore plugin now supports v2 of authentication SDKs, so this issue is fixed. Closing.