-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a login flow via pyDataverse to retrieve an API Token via Dataverse/a browser #209
Comments
Yesterday, @JR-1991 and I had a productive programming session around the OIDC login. When doing a login via OIDC on Dataverse via the browser, the process is roughly like this: sequenceDiagram
participant B as Browser
participant D as Dataverse
participant K as Keycloak/IdP
B->>D: requests OIDC information
D->>B: returns auth URL and start code as <a href>
B->>K: opens auth URL
K->>B: returns login page
B->>K: submits credentials
K->>B: returns response including result code with redirect to redirect URI
B->>D: follows redirect, passing result code
D->>K: passes result code
K->>D: returns identity information as JWT
D->>B: responds with Cookie containing JWT
We managed to basically replace the browser for some of the steps, allowing us to a) find out the Dataverse Client ID to tell Keycloak for which client we require credentials and b) retrieve the Cookie Dataverse sets so that we get a Bearer token and not the browser. sequenceDiagram
participant P as pyDataverse
participant B as Browser
participant D as Dataverse
participant K as Keycloak/IdP
P->>D: requests OIDC information
D->>P: returns auth URL and start code as <a href>
P->>P: rewrites redirect URL
create participant L as local server
P->>L: starts local server
P->>B: opens auth URL in browser
B->>K: opens auth URL
K->>B: returns login page
B->>K: submits credentials
K->>B: returns response including result code with redirect to redirect URI
B->>L: follows redirect, passing result code
L->>P: passes result code
destroy L
P->>L: stops local server
P->>D: passes result code
D->>K: passes result code
K->>D: returns identity information as JWT
D->>P: responds with Cookie containing JWT
We got a toy example for this flow working, but a few open questions remain:
Anyways, this was a very productive session and we plan to continue with an actual implementation for pyDataverse next week. |
In https://dataverse.zulipchat.com/#narrow/stream/377090-python/topic/auth.20options, we discussed different options to ease the access to Dataverse with pyDataverse / CLI / API clients.
One of the options is similar to kubectl's and nomad's authentication mechanisms: You open a browser to retrieve a (bearer) token, login to your favorite OIDC provider with a callback to localhost, and get the token passed to a temporarily started local webserver.
In this issue we want to track ideas about how to make it this work.
The text was updated successfully, but these errors were encountered: