3

I have a big issue with mobilefirst, when I try to call a protected resource I have this issue:

The issue is on Android only, iOS works perfectly.

evaluateJavascript=cordova.callbackFromNative('WLResourceRequestPlugin368975848',false,9,[{"status":400,"statusText":"Bad Request","responseText":"{\"errorCode\":\"invalid_client\",\"errorMsg\":\"Incorrect JWT format\"}","responseJSON":{"errorCode":"invalid_client","errorMsg":"Incorrect JWT format"},"responseHeaders":{"X-Powered-By":"Servlet/3.1","Content-Type":"application/json","Content-Language":"en-US","Transfer-Encoding":"chunked","Connection":"Close","Date":"Wed, 31 May 2017 16:13:55 GMT","OkHttp-Sent-Millis":"1496218412371","OkHttp-Received-Millis":"1496218412405"},"errorMsg":"Incorrect JWT format","errorCode":"invalid_client"}],false);

The problem is I checked the client time and server time, and they are identical, but when i change the client time and add one day it works! How can I fix this issue?

halfer
  • 19,824
  • 17
  • 99
  • 186
Mejri Yassine
  • 99
  • 1
  • 8
  • Please read [Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers?](https://meta.stackoverflow.com/q/326569) - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions. – halfer May 31 '17 at 10:05
  • Thank you for your answer, still didnt get an answer for my question – Mejri Yassine May 31 '17 at 10:52
  • 1
    Sure. Exercising a little patience is worthwhile - no-one owes you an answer. Please do read that link, and remember that most folks here are volunteers. Perhaps someone will be along in the next day or so to answer this. – halfer May 31 '17 at 10:55

1 Answers1

8

"Incorrect JWT format" can result if the client device's time is not synchronized with that of the server. Client and server should be synchronized or the client should be ahead of the server in time ( client should be in the future when compared to server). You should ensure that server should NOT be running a time greater than client. This error message can result even if the time difference is a second ( in case client is not synchronized with the server or running ahead of it).

Vivin K
  • 2,681
  • 1
  • 11
  • 14