Welcome to the forum! Please could you provide more information on your problem so others can help you? If you’re not sure what to include please have a look at https://betatim.github.io/posts/getting-answers/
I got the same error : Permission failure checking authorization, I may need a new token
The context was JupyterHub and JupyterLab running in docker (using SwarmSpawner)
From the notebook’s stdout + err (because the notebook was successfully spawned, but the user couldn’t access to it), I got
I 2020-11-12 15:32:40.013 SingleUserNotebookApp log:174] 302 GET /user/xyz/lab? -> /hub/api/oauth2/authorize?client_id=jupyterhub-user-xyz&redirect_uri=%2Fuser%2Fxyz%2Foauth_callback&response_type=code&state=[secret] (@10.0.0.2) 8.28ms
[D 2020-11-12 15:32:40.521 SingleUserNotebookApp auth:501] No user identified
[D 2020-11-12 15:32:40.596 SingleUserNotebookApp auth:310] HubAuth cache miss: token:d596ca07400948068286afd2d153a1c5:bBsx2AnfWwsYlhv0uxGdVcpgRnDgeW
[E 2020-11-12 15:32:40.611 SingleUserNotebookApp auth:354] I don't have permission to check authorization with JupyterHub, my auth
token may have expired: [403] Forbidden
Solution :
After 2 hours of test, I discovered that it was due to the presence of a .netrc file, with this content :
default login anonymous password user@site
More precisely, I checked that the error was due to the presence of the keyword default
Ok I solved my issue, but can someone explain to me the usage of that .netrc file with JupyterHub (+JupyterLab) ?
As far as I know JupyterHub doesn’t use that file directly, but it’s possible some of its dependent libraries take it into account when making network requests: