Gaurab Kumar
Gaurab Kumar

Reputation: 2174

IBM MobileFirst 8 - Push Notification errorCode: invalid_client

I am getting the following error while registering the device for push notification in android,

Failed to register device:"com.ibm.mobilefirstplatform.clientsdk.android.push.api.MFPPushException: Response: Status=400, Text: {\"errorCode\":\"invalid_client\",\"errorMsg\":\"Incorrect JWT format\"}, Error Message: Incorrect JWT format"

Found the similar question but no clear figure :

IBM MobileFirst v8 trying to obtain Token on android cordova app after successful login challenge handler

Cordova Android application getting "invalid_client" from Mobile First 8.0 server

Any solution or suggestion will be appreciable.

Upvotes: 0

Views: 645

Answers (3)

mhoff
mhoff

Reputation: 610

I had the same issue, Rebooting the client device / emulator helped me.

( The the "check server time" was not practical for me, my Server runs as Bluemix service in US )

BTW: I can reproduce this "Incorrect JWT format" in the android emulator: If the android emulator is running overnight and I try the next day, I always get this error (until restarting the emulator)

Upvotes: 0

Vivin K
Vivin K

Reputation: 2681

The most common cause of the issue is failure in time synchronization between client and server. Verify if the server time if offset from the client. Specifically if the server has a time in past.

Upvotes: 0

Raghavendra Rao
Raghavendra Rao

Reputation: 130

Looks like you are missing the step in the android platform. In Android Studio, add the following activity to the application tag:

<activity android:name="com.ibm.mobilefirstplatform.clientsdk.android.push.api.MFPPushNotificationHandler" android:theme="@android:style/Theme.NoDisplay"/>

Upvotes: 0

Related Questions