0

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"

  • MFP Server: 8.0.0.00-20170220-1900
  • Cordova : 6.1.1
  • cordova-plugin-mfp : 8.0.201703309
  • cordova-plugin-mfp-push: 8.0.2017012410

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.

Gaurab Kumar
  • 2,144
  • 2
  • 17
  • 29

3 Answers3

0

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"/>
0

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.

Vivin K
  • 2,681
  • 1
  • 11
  • 14
  • how to overcome this issue if my server & client are in different time zone ? – Gaurab Kumar Apr 22 '17 at 08:01
  • Also when I add security scope push.mobileclient, it take too long to save. – Gaurab Kumar Apr 22 '17 at 08:03
  • The matter is not about timezone. The synchronization is "number of seconds since 1970". See to it that the server is not set a time in the distant past. If you still see the issue, open a PMR – Vivin K Apr 22 '17 at 10:35
  • Your line.. See to it that the server is not set a time in the distant past... , What does it mean ?? How to check server time ? – Gaurab Kumar Apr 22 '17 at 13:25
0

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)

mhoff
  • 601
  • 8
  • 13