Skip to content

Allow custom authentication/middleware in config.yaml - #930

Merged
SchrodingersGat merged 2 commits into
inventree:masterfrom
bcc:feature-custom-authentication
Aug 24, 2020
Merged

SchrodingersGat merged 2 commits into
inventree:masterfrom
bcc:feature-custom-authentication

Conversation

@bcc

@bcc bcc commented Aug 24, 2020

Copy link
Copy Markdown
Contributor

It is useful to be able to customise the middleware / authentication_backends without editing settings.py. This PR optionally loads them from config.yaml.

My use case is to be able to add 'django.contrib.auth.middleware.RemoteUserMiddleware' to MIDDLEWARE and set AUTHENTICATION_BACKENDS to 'django.contrib.auth.backends.RemoteUserBackend' to make inventree use the REMOTE_USER variable alongside client certificate TLS auth.

I'm happy to maintain this change in a local branch if you're not keen, but I thought it might potentially be a useful option for others.

@bcc

bcc commented Aug 24, 2020

Copy link
Copy Markdown
Contributor Author

This also potentially helps with #625 if the SSO system / webserver supplies REMOTE_USER.

@SchrodingersGat

Copy link
Copy Markdown
Member

Sure, this seems like a reasonable addition to me!

@SchrodingersGat
SchrodingersGat merged commit cd016d3 into inventree:master Aug 24, 2020
@bcc
bcc deleted the feature-custom-authentication branch August 31, 2020 16:54
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