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

feature: middleware to fix /auth/login/ page #32

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mavriq
Copy link

@mavriq mavriq commented Mar 29, 2022

feature: added middleware to fix /auth/login/ for adding link to login via OIDC to organisations

@max-wittig
Copy link
Member

@mavriq Sorry I missed this MR! Will look at it now

@mavriq
Copy link
Author

mavriq commented Apr 5, 2022

Hi, @max-wittig
I hope, you looked my PR
And its doesn't look very strange

I used BeautifulSoup and MIDDLEWARE because we have no simple method to extend login page in sentry

@max-wittig
Copy link
Member

@mavriq Mhmm I'm not really sure what it does. Could you provide some sort of screenshot or so?

@mavriq
Copy link
Author

mavriq commented Apr 5, 2022

just now I can't make screeenshot, but I can tell you how it work:

  1. here sentry/conf/server.py sentry set path to ROOT_URLCONF
  2. here sentry/conf/urls.py it extends urlpatterns from sentry.web.urls.urlpatterns
  3. here sentry/web/urls.py it adds sentry.web.frontend.auth_login.AuthLoginView as handler of ^auth/login/ named as sentry-login
  4. after all this we have chain of calls:
  1. see all next steps in sentry/templates/sentry/login.html
  2. in middleware we:

later I try to create screenshot

@mavriq
Copy link
Author

mavriq commented Apr 6, 2022

@max-wittig, as you asked, screenshot of <sentry-host>/auth/login/:
sentry-login-oidc

@mavriq
Copy link
Author

mavriq commented Apr 9, 2022

Hi, @max-wittig, have you some news about this PR?
I would really like this functionality to be in upstream, and I could use the package from pypi, and not manually patched

I didn't find an easier way.
this one works reliably.

@max-wittig
Copy link
Member

@mavriq I'm not sure, this seems a bit patched. Normally we use the button on the right of your screenshot Single Sign-On. Have you tested it with multiple organizations? What happens then? Which one does it login with?

_orgs = Organization.objects.filter(
id__in=(AuthProvider.objects.filter(provider='oidc')
.values('organization_id')))
for org in _orgs:
Copy link
Member

Choose a reason for hiding this comment

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

we have like 50 organizations in one instance. That would really mess up the page.

Copy link
Author

Choose a reason for hiding this comment

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

hmm
yes, it must look crazy
can we add regex-variable to filter by slug-field? with default value .*

Copy link
Author

Choose a reason for hiding this comment

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

In the 970f1e2 I did it

Copy link
Author

Choose a reason for hiding this comment

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

@max-wittig maybe, you want add scrolbar, or move list of organizations to select/select2 ?
I can do it, but it will be ugly

Copy link
Member

Choose a reason for hiding this comment

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

@mavriq I'm not sure why we should follow this direction at all to be honest. Why can't the user just type in the org on the right?

@dlouzan
Copy link
Member

dlouzan commented Feb 26, 2024

@max-wittig I guess we can close this one as it's not the direction we want to go?

@max-wittig
Copy link
Member

@mavriq Thanks for your contribution here, but sadly this doesn't follow our direction for this project.

Maybe, if you really want it you could make it optional?

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.

3 participants