Closed brands-d closed 1 year ago
Hi @brands-d!
Looking at your error, it seems like some sort of an issue with checking the time after which the token is valid.
After authentication, you will receive a special piece of signed information (JWT) that contains some details about the signed in person. This information also contains a timestamp, which indicates a point in time at which the information was issued at, called "iat". You are getting an error saying that somehow the server looking at the token thinks that it has not been issued yet.
The underlying reason might be a small time difference between the two different servers (the one creating the JWT, and the one that is validating it, these might very well be different physical machines) since it looks like you are getting errors quite randomly. I think the usual solution is to allow for a small 'leeway' in the checking of these timestamps that allows for a small time difference.
Let us investigate a bit if there is something we can do on our end to solve this.
Thank you for the quick response!
Actually not necessary, your analysis was correct. A port on our server was closed preventing it from synchronzing the time on the host properly and we ran about 20s behind. Fixing this also resolved this issue. Thanks for your efforts and sorry as this was entirely on our end!
Ok, great, thanks for the update!
I had the same issue, after a while, it seems that the time from the host have got out of sync.
Would it be worth to add to the NOMAD Oasis setup instruction that time synchronisation needs to be enable on the server?
Yes, we should add this to our documentation. What do you think would be the most logical place to put this in our current documentation structure? I would propose some kind of a note here: Provide and connect your own user management
Since this would affect server using the centralised or own user management with / without docker, I would say that this would go best in a "pre-requisites" or maybe troubleshooting section, depending if this can be considered as a rate occurrence or not? I don't know how often this issue would occur and if this is something specific to my case - host is a rocky linux virtual machine that was setup by my IT department.
If people are missing it when setting the server, they should be able to find it quickly with searching the relevant keyword of the error message in the documentation.
Thanks for the suggestion. I have now added a new "Troubleshooting" section to the OASIS install docs. After we update our deployments it will become part of the online docs.
We started hosting a NOMAD Oasis Server (https://physikoasis.uni-graz.at/nomad-oasis/) using the central user management provided. However one of our users receives a "Could not validate credentials. The given token is invalid. (401)" error messages as a small red pop up at the bottom left and the server prints the following text when receiving the request.
This does not occur for other users and it doesn't even occur consistently everytime for this particular user (myself: dominik.brandstetter@uni-graz.at). Opening the "Publish->Dataset" entry is possible, however opening an entry there usually isn't. Sometimes clicking around the UI for a while allows the user to open other pages but no consistently working approach has been found. Uploading data using the UI or curl did not work flawlessly for this user but only after 2-3 attempts.
Error message: