Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Split authenticate into separate overridable function #374

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

Merged
peppelinux merged 3 commits into IdentityPython:master from uktrade:master
May 1, 2023

Conversation

@marcelkornblum
Copy link
Contributor

@marcelkornblum marcelkornblum commented Apr 28, 2023
edited
Loading

This PR splits the user authentication in the AssertionConsumerServiceView into a separate function that can be overridden separately. No functionality has been changed.

We've been using this library for a long time and have multiple IdPs that we connect to. Unfortunately that means we sometimes get duplicate user records created, where the same individual has accounts with more than one IdP. We're changing our flow to incorporate merging records together, but as part of that we need users to authenticate with their IdP for the second record / email address we will merge with. We want this to complete without them automatically then logging in to that account.

The cleanest way we can see to do this would be to override just the user authentication part of the post method of the AssertionConsumerServiceView meaning that we are confident that the user controls the account but we keep the user from their first auth available. This change means that we don't have to work around it with overrides to the backend and the handle_acs_failure methods, which would be possible but inelegant.

This small change would allow our flow to work tidily and be easy to understand. We appreciate any feedback you may have.

/cc @jafacakes2011 @lgarvey

CamLamb and lgarvey reacted with heart emoji
* split authenticate into separate overridable function
* cleaner exception
* basic unit test
* remove new test
* space to revert change
@marcelkornblum marcelkornblum changed the title (削除) split authenticate into separate overridable function (削除ここまで) (追記) Split authenticate into separate overridable function (追記ここまで) Apr 28, 2023
* split authenticate into separate overridable function
* cleaner exception
* basic unit test
* remove new test
* space to revert change
* return the user
Copy link
Member

Please can I ask you to increase the version number here as well?
https://github.com/IdentityPython/djangosaml2/blob/master/setup.py#L30

I don't see this as an additional feature, so I'd go for 1.5.7, but feel free to give your suggestions also for this

marcelkornblum reacted with thumbs up emoji

Copy link
Contributor Author

Absolutely - and yes agree it's not a feature; I've bumped it to 1.5.7

Thanks!

@peppelinux peppelinux merged commit 6c7f760 into IdentityPython:master May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@peppelinux peppelinux peppelinux approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /