I’ve been working on setting up an external authentication flow for the new REST APIs with Jupyterhub. I was wondering if there is a way to convert a token that is passed in into not only a user’s info, but also get back which token ID or the token information on that token. I have a requirement to monitor the token’s metadata and just trying to see how to do that. Is that doable? And if so, how?
Thanks for your reply. When I make a call to /users/{name}/tokens, I don’t see the “token” key specified in the REST API. What permission is required to see that key?
What I’m meaning is in the return JSON from htting the /users/{name}/tokens endpoint. What I called the “token key” is the part ““token”: “string””. I’m not seeing this when calling this endpoint. Was there a version it was released in or does it require some specific permissions to view?
I understand what you’re asking now- the docs are slightly misleading, token is only included in the response for new token requests (POST), it’s omitted when retrieving an existing token for security. If you need to delete a token you can reference it using id.
So then, is there a way where a user could pass in a fully fledged token and then I could somehow get the metadata on that token from the token itself? The reason I ask is I had to expand/update the Jupyterhub authentication within the dask gateway application and in order to do that, I had to determine from an incoming token what the token’s metadata is. I couldn’t find it, hence this q/a. Is there a way to peer these together, or once a token is created, you can’t pull its metadata from just looking at the token itself?
So then, is there a way where a user could pass in a fully fledged token and then I could somehow get the metadata on that token from the token itself?