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 external auth support #1039

Merged
merged 7 commits into from
Jun 2, 2023
Merged

Add external auth support #1039

merged 7 commits into from
Jun 2, 2023

Conversation

dekkers
Copy link
Contributor

@dekkers dekkers commented May 24, 2023

This adds external auth support using Django remote user middleware. The header to be used can be configured using the REMOTE_USER_HEADER environment variable. The REMOTE_USER_FALLBACK variable can be set to enable the fallback to the normal model based auth backend.

I also changed the settings to only enable the OpenTelemetry middleware when SPAN_EXPORT_GRPC_ENDPOINT is set.

Fixes #963

@dekkers dekkers requested a review from a team as a code owner May 24, 2023 15:04
@Donnype
Copy link
Contributor

Donnype commented May 24, 2023

When I log in and try to change the language I get the following:

image

@underdarknl
Copy link
Contributor

underdarknl commented May 29, 2023

When I log in and try to change the language I get the following:

image

I'm still having issues with the notion that we need to do a POST for changing a language. But that's unrelated to this issue.
I'm guessing somewhere along the way the cookies get lost due to some https / secure cookie flags or allowed domains not being set correctly.

@dekkers
Copy link
Contributor Author

dekkers commented May 29, 2023

When I log in and try to change the language I get the following:
image

I'm still having issues with the notion that we need to do a POST for changing a language. But that's unrelated to this issue. I'm guessing somewhere along the way the cookies get lost due to some https / secure cookie flags or allowed domains not being set correctly.

The problem is #1025 and unrelated to this PR. I added CSRF_TRUSTED_ORIGINS to the settings on the test server and that fixes the problem.

@praseodym praseodym self-requested a review May 31, 2023 08:38
@Darwinkel
Copy link
Contributor

Checklist for QA:

  • I have checked out this branch, and successfully ran a fresh make reset.
  • I confirmed that there are no unintended functional regressions in this branch:
    • I have managed to pass the onboarding flow
    • Objects and Findings are created properly
    • Tasks are created and completed properly
  • I confirmed that the PR's advertised feature or hotfix works as intended.

I personally have no external authentication services running, so I can't actually test remote user support.

What works:

  • Non-remote (model) user management still works

What doesn't work:

  • kattest01.openkat.dev throws a 500 after attempting to login ;(

@underdarknl underdarknl merged commit 5d6b4b8 into main Jun 2, 2023
@underdarknl underdarknl deleted the add-external-auth-support branch June 2, 2023 09:01
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.

External authentication using REMOTE_USER
6 participants