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

Add login endpoints and UI scripts to use them #15

Merged
merged 2 commits into from
Sep 5, 2024

Conversation

mrtamm
Copy link
Contributor

@mrtamm mrtamm commented Sep 2, 2024

Here are changes that are designed to solve issue #13.

There are also some configuration changes regarding Server.OidcAuth:

  1. ServiceConfigUrl was renamed to ServiceConfigURL to follow "URL" naming convention used in other parameters
  2. Added RedirectURL to specify where the user needs to be redirected after the login (application's endpoint)

In general, two HTTP endpoints were added:

  1. /login – this redirects user to OIDC login page, or otherwise requests Basic credentials, or otherwise just redirects user back to root path when no authentication is configured.
  2. /login/token – this returns the JWT token for the frontend to use (if OIDC is not used, this response will be an empty HTTP 200). If OIDC is configured but user is not authenticated, the response will be HTTP 404.

The frontend side was updated to first attempt to retrieve a token from /login/token. On failure, the user will be redirected to the /login path, which initiates the login flow.

Note that this login flow is possible only with the HTTP-based API and not with the gRPC API.

@xhejtman
Copy link
Contributor

xhejtman commented Sep 5, 2024

seems to be failing a bit?

@mrtamm
Copy link
Contributor Author

mrtamm commented Sep 5, 2024

Please try the failing job once again. It succeeded in my repo.

@xhejtman xhejtman merged commit 218b6e4 into CERIT-SC:master Sep 5, 2024
5 checks passed
@mrtamm mrtamm deleted the dev-ui-login-flow branch September 6, 2024 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants