Using binder build API with authentication enabled from custom built UI


Is there any way to use binderhub’s SSE based build endpoint from custom frontend created using React/Angular.

Use Case:
We would like to provide multiple repos from the UI (kind of hardcoded repos). So that user doesn’t need to know the repo names.

Since binderhub uses jupyterhub as the oauth provider. I am not sure on how to authenticate it externally. Also we do not want to redirect to binderhub homepage.

For jupyterhub external authentication we are using keycloak as oauth provider. So from our UI we are logging into keycloak and we redirect to jupyterhub since we are using same client for jupyterhub we are able to complete Jupyterhub authentication and redirecting back to our UI which will store cookie in browser. We tried forwarding same cookie to the binderhub build API which just goes to login again and doesn’t seem to complete.