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?
"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).