Skip to content
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

vdk-jupyter: add oauth2 authentication implementation #2590

Merged
merged 4 commits into from
Aug 24, 2023

Conversation

antoniivanov
Copy link
Collaborator

@antoniivanov antoniivanov commented Aug 21, 2023

This is adding the server part of Oauth2 authentication process.

It adds 1 more APIs: /login

When called it without "code" query paramter, it will start the authentication proces as per OAuth2 standard .
We are using only native app workflow with PKCE (RFC 7636) because we cannot really secure the server side so we cannot reliably use client secret.
When called with "code" query paramter it will finish the process and exchange the code for access token (and refresh token) and safe it in VDK storage.

This change add integration with jupyter configuration. This way the extension can be configured more natively using jupyter configuration mechanism.

So now configuration can be set in any of the ways juptyer server supports - https://jupyter-server.readthedocs.io/en/latest/users/configuration.html

E.g
I've set locally in ~/.jupyter/jupyter_lab_config.py

c.VdkJupyterConfig.oauth2_authorization_url = "https://console.cloud.vmware.com/csp/gateway/discovery"
c.VdkJupyterConfig.oauth2_token_url = "https://console.cloud.vmware.com/csp/gateway/am/api/auth/authorize"
c.VdkJupyterConfig.oauth2_client_id = "xxx"
c.VdkJupyterConfig.rest_api_url = "https://supercollider.vmware.com/"    

In future change we can add integration between VDK configuration mechanims and jupyter so that properties set in VDK can be recognized in Jupyter and vice-versa but that's more advanced use-case

Copy link
Collaborator

@duyguHsnHsn duyguHsnHsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good to me!

antoniivanov and others added 4 commits August 23, 2023 10:54
This is adding the server part of Oauth2 authentication process.

It adds 1 more APIs: `/login`

When called it without "code" query paramter, it will start the
authentication proces as per OAuth2 standard .
We are using only native app workflow with PKCE (RFC 7636) because we
cannot really secure the server side so we cannot reliably use client
secret.
When called with "code" query paramter it will finish the process and
exchange the code for access token (and refresh token) and safe it in
VDK storage.

This change add integration with jupyter configuration. This way the
extension can be configured more natively using jupyter configuration
mechanism.

In future change we can add integration between VDK configuration
mechanims and jupyter so that properties set in VDK can be recognized in
Jupyter and vice-versa but that's more advanced use-case
@antoniivanov antoniivanov merged commit 7fd61fb into main Aug 24, 2023
8 of 9 checks passed
@antoniivanov antoniivanov deleted the person/aivanov/jupyter branch August 24, 2023 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants