Hi. I have a REST server implemented that offers a generic data service. I would like Hub users to be able to:
- Access datasets using the REST API
- Publish datasets using the REST API
- Query the datasets or obtain lists of what data sets are available
The server has been implemented standalone, along with JavaScript and Python client libraries. However, I’d like to attach it to JupyterHub as a (preferably managed) service and use JupyterHub to validate the userid’s.
It’s really clear how to do this if the user is primarily accessing an interactive service. But what I’m struggling with is how to attach authentication to API requests. Ideally, if the user has logged into the hub, the client (which I’ve written and can modify) will pick up the authentication automatically and use it.
Is there a pointer (ideally, to some sample code) that I can use?
Oh, and if the request is coming from code running on a Notebook server, e.g. a Notebook kernel, no authentication should be required.
Many thanks for all of your help.