Skip to content

[11.0][FIX] auth_saml: avoid context propagation when registering 2 accounts #771

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

Open
wants to merge 1 commit into
base: 11.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion auth_saml/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
# ----------------------------------------------------------


def clean_context(context):
""" This function take a dictionary and remove each entry with its key starting with 'default_' """
return {k: v for k, v in context.items() if not k.startswith('default_')}


def fragment_to_query_string(func):
@functools.wraps(func)
def wrapper(self, req, **kw):
Expand Down Expand Up @@ -174,7 +179,7 @@ def signin(self, req, **kw):
state = simplejson.loads(kw['RelayState'])
provider = state['p']
dbname = state['d']
context = state.get('c', {})
context = clean_context(state.get('c', {}))
registry = registry_get(dbname)
with registry.cursor() as cr:
try:
Expand Down