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

feat: Add custom parameter support to hooks for multi tenant use cases #352

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

j0x539
Copy link

@j0x539 j0x539 commented Nov 25, 2024

This PR is related to #351

@CLAassistant
Copy link

CLAassistant commented Nov 25, 2024

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


John Christoforidis seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@mostafa
Copy link
Member

mostafa commented Nov 25, 2024

@j0x539 Please sign the CLA.

Copy link
Member

@mostafa mostafa left a comment

Choose a reason for hiding this comment

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

Except a nit, overall LGTM!

django_saml2_auth/saml.py Outdated Show resolved Hide resolved
@j0x539 j0x539 requested a review from mostafa November 25, 2024 17:04
@mostafa
Copy link
Member

mostafa commented Nov 26, 2024

@j0x539 Can you please fix the failing CI steps. I think linter is complaining.

@j0x539
Copy link
Author

j0x539 commented Nov 26, 2024

@j0x539 Can you please fix the failing CI steps. I think linter is complaining.

Sure thing, the codebase seems to put # type: ignore to suppress the linter warning for run_hook calls, is that a satisfying solution?

@j0x539
Copy link
Author

j0x539 commented Nov 26, 2024

I've been looking at the signin handler without realizing I essentially implemented what sp_initiated_login does. Though, it should still be helpful to pass a parameter such as the existing user_id into get_custom_acs_url don't you think?

@mostafa
Copy link
Member

mostafa commented Nov 26, 2024

@j0x539 If that's the case, then one can use a JWT token to figure out user_id and/or email and then use that to prepare the client for authentication, and redirect them to the correct URL.

@j0x539
Copy link
Author

j0x539 commented Nov 26, 2024

You're right, I figured that out now, thank you. if there's any part of the changes which you might still deem useful I'll be happy to make changes otherwise we can close the PR and related issue - not sure why the test deployment fails now. Also could you redact my name in the two instances CLAassistant mentioned it? 🙏

@mostafa
Copy link
Member

mostafa commented Nov 26, 2024

@j0x539 I'll have another look tomorrow and then we can decide what to do with this.

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