Created a service and an api token (openssl rand -hex 32) for an application that is making REST API calls to Jupyterhub. Successfully deployed Jupyterhub version 1.2.2 a week ago. There have been no subsequent redeployments of Jupyterhub.
The application was able to successfully execute the Jupyterhub REST API for about a week. Then all of a sudden, the application started to receive HTTP 403 errors on all of its REST API calls to Jupyterhub.
All of the smoke tests I created in Postman (e.g., GET http://hub/api/proxy) using the same API token started to fail. I was able to successfully execute the same smoke tests with the same API token last week; and all of a sudden they started to fail with a 403 error.
I am totally perplexed. Looked at the Jupyter and Tornado source code and tried to figure out where or what is throwing the 403 error. None of the Jupyter handlers or api handlers seem to be the culprit. Same goes for the base Tornado RequestHandler. At least that is my observation; and I could be wrong.
Do API tokens that are used for services have an expiration timestamp? Is it possible that the api token has expired?
Code snippet below shows how we are setting up the api token for the service.
c.JupyterHub.services = [
{
“name”: “service-token”,
“admin”: True,
“api_token”: os.getenv(“JUPYTER_API_TOKEN”),
},
]
Using Jupyterhub 1.2.2.
Please advise.