-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Unauthorized: Unauthorized.
for a newly created token
#90
Comments
Error: Unauthorized: Unauthorized.
for a newly created cacheError: Unauthorized: Unauthorized.
for a newly created token
I ran into the same issue but generated my token with
I also had to set |
Same here: https://github.com/klarkc/os/blob/3dd316c8dcf3fb6293f8556cdab452fd3bcdca13/setups/cache/default.nix I was wondering, if we need to create token, why we need to set |
I ran in to this problem and the core issue is that the not-valid-after timestamp in the JWT is computed by adding the validity period to the current time since the epoch (1970-01-01) as a 32-bit unsigned integer. This wraps around sometime in 2106 meaning that as computed for the JWT 100 years from now is in the past. It doesn't help that any issues with tokens are logged only at the debug level and not reported in any way to the client. |
I'm not sure that's the only issue. I've just set up a new attic server with this nixos module:
The atticd service has started successfully and I can generate tokens (although I have to use sudo - |
I think you need to give all your grants when creating the token. If you created it with that exact command line it has none. |
🤦🏽 Thanks, that worked. My initial server output didn't have the JWT:
Edit: more information about why that happened here |
May I ask if anyone can give a little TL;DR what you need to do to fix this? Because I'm a bit confused regarding the credentialsFile = config.sops.secrets."attic.env".path; setting. Do we still need it, if we have to create the token manually? |
You have to create a token on the attic server. The line you quoted from my example is using a pregenerated token with https://github.com/Mic92/sops-nix as a secure way of sharing it |
but what is the correct way to create the token now? Is this still the correct way or do I have to execute |
Sorry, I misread your original message and was conflating two things. There is the credentials file (which is the HS256 secret generated as per your last message) for the attic server, and then each client that uses the server will need to use a JWT generated with |
oh, so the credentials file contains something else. Good to know. Thank you! |
Hm... I'm still getting the error message. What could I have done wrong? |
Would be nice if anyone could help me here :) #166 (comment) |
What am I doing wrong?
The text was updated successfully, but these errors were encountered: