Skip to content

Add blocklist and allowlist for oidc domains - #28

Open
jawabuu wants to merge 5 commits into
siemens:masterfrom
jawabuu:filter-domains
Open

Add blocklist and allowlist for oidc domains#28
jawabuu wants to merge 5 commits into
siemens:masterfrom
jawabuu:filter-domains

Conversation

@jawabuu

@jawabuu jawabuu commented Apr 23, 2021

Copy link
Copy Markdown

This introduces 2 variables
OIDC_DOMAIN_BLOCKLIST
OIDC_DOMAIN_ALLOWLIST
to filter out which email domains are allowed to login when using SSO.
Related issue
#27
It is possible to do away entirely with these new variables if equivalent setting for domains can be found. However, this seems not to be available.
getsentry/self-hosted#2894

@jawabuu

jawabuu commented Apr 24, 2021

Copy link
Copy Markdown
Author

@max-wittig @ercanucan I have tried as much as possible to keep with your philosophy of keeping the codebase as close as possible to upstream.
The changes made are all opt-in via the 2 env-variables and do not change existing behaviour before the PR.
I also have created a branch from v4.0.1 for compatibility/backporting with the latest release
https://github.com/jawabuu/sentry-auth-oidc/tree/filter-domains-v4.0.1
and this can be merged to existing latest version.

@max-wittig

Copy link
Copy Markdown
Member

Sorry I totally missed your MR. Didn't get any notifications for it. Will take a look in the next few days!

@max-wittig max-wittig left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the MR. Just some suggestions added

Comment thread oidc/views.py Outdated
Comment thread oidc/views.py Outdated
Comment thread oidc/constants.py
@max-wittig

Copy link
Copy Markdown
Member

Regarding your commit messages. Could you please ensure that these comply with the conventional changelog? Thanks 👍

@jawabuu

jawabuu commented May 11, 2021

Copy link
Copy Markdown
Author

Thanks @max-wittig I'll address these immediately.

@dlouzan

dlouzan commented Feb 26, 2024

Copy link
Copy Markdown
Member

@max-wittig Would we want to take another look at this now that builds are fixed again?

/cc @nejch

Comment thread oidc/views.py
@CLAassistant

CLAassistant commented Oct 31, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@bufferoverflow

Copy link
Copy Markdown
Member

I wonder somehow why this can not be solved at the IdP level when you register the app.

@jawabuu

jawabuu commented Nov 8, 2025

Copy link
Copy Markdown
Author

I wonder somehow why this can not be solved at the IdP level when you register the app.

This would be ideal but unfortunately that is not exposed by public providers e.g. Gitlab
Additionally, this was a feature that was available in this package but was accidentally removed.

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.

5 participants