Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.
[SOLVED] "Failed to create authentication token: Bad Request"
-
Running the latest version of Mango with all modules up to date. When I go to generate a JWT token for any user I get the error message "Failed to create authentication token: Bad Request"
Here is the corresponding error output from the logs: https://pastebin.com/XF3CbaLM
The first line is:
ERROR 2018-01-29T13:26:50,292 (com.serotonin.m2m2.web.mvc.rest.v1.exception.RestExceptionHandler.handleExceptionInternal:74) - Cannot deserialize value of type `java.util.Date` from String "2018-02-05T22:26:48.933Z": not a valid representation (error: Failed to parse Date value '2018-02-05T22:26:48.933Z': Unparseable date: "2018-02-05T22:26:48.933Z")
We are running this version of java:
$ java -version java version "1.8.0_131" Java(TM) SE Runtime Environment (build 1.8.0_131-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
Please let me know what additional information I can provide.
-
@adamlevy Looks like we haven't specified the defaults correctly for the date format, add this to your env.properties file and you should be fine.
rest.customDateOutputFormat=yyyy-MM-dd'T'HH:mm:ss.SSSXXX rest.customDateInputFormat=yyyy-MM-dd'T'HH:mm:ss.SSSXXX
-
This worked for me. Thank you!
BTW we had rest.customDateOutputFormat already specified in our env. properties file, it was just the wrong format. So the hard coded defaults are probably fine.