Skip to content

[DTOSS-10297] HTTP basic authentication#244

Closed
MatMoore wants to merge 5 commits intomainfrom
DTOSS-10297-basic-auth-2
Closed

[DTOSS-10297] HTTP basic authentication#244
MatMoore wants to merge 5 commits intomainfrom
DTOSS-10297-basic-auth-2

Conversation

@MatMoore
Copy link
Copy Markdown
Contributor

@MatMoore MatMoore commented Jul 30, 2025

Description

This PR adds middleware that authenticates using HTTP basic authentication, configured by environment variables.

Screenshot of basic authentication prompt

This is not integrated with django.contrib.auth - so request.user.is_authenticated is still False after submitting valid credentials.

The plan is to introduce a separate page that will allow you to choose the persona you want to log in as. This will only be available on non-production environments.

Jira link

https://nhsd-jira.digital.nhs.uk/browse/DTOSS-10297

Review notes

For context - here is my earlier approach, which logged in a user if the basic auth was successful.

MatMoore added 5 commits July 30, 2025 16:05
(not sure why this wasn't failing before)
This will be used on non-production environments so that non-team
members don't confuse them with live services.

Later, we'll add a personas page for force-logging in users with
different roles/permissions.
@MatMoore MatMoore marked this pull request as ready for review July 30, 2025 15:22
@MatMoore MatMoore closed this Aug 4, 2025
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.

1 participant