Felipe
(Felipe Montoya)
March 23, 2023, 5:10pm
5
You can see an example here:
class EoxTenantAuthException(AuthFailed):
"""Auth process exception."""
def __init__(self, backend, *args, **kwargs):
self.backend = backend
super().__init__(*args, **kwargs)
# pylint: disable=unused-argument,keyword-arg-before-vararg
def safer_associate_by_email(backend, details, user=None, *args, **kwargs):
"""
Associate current auth with a user with the same email address in the DB.
This pipeline entry is not 100% secure. It is better suited however for the
multi-tenant case so we allow it for certain tenants.
It replaces:
https://github.com/python-social-auth/social-core/blob/master/social_core/pipeline/social_auth.py
"""
if user:
You would create a new step in your plugin and then alter the settings so that you replace the step 'common.djangoapps.third_party_auth.pipeline.associate_by_email_if_oauth'
with your own.