-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add documentation for post_authenticate signal
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ Contents | |
settings_ref | ||
config_guides | ||
middleware | ||
signals | ||
rest_framework | ||
demo | ||
troubleshooting | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Django Signals | ||
================ | ||
|
||
**django-auth-adfs** uses Django `Signals <https://docs.djangoproject.com/en/stable/topics/signals/>` | ||
to allow the application to listen for and execute custom logic at certain points in the authentication | ||
process. Currently, the following signals are supported: | ||
|
||
* ``post_authenticate``: sent after a user has been authenticated through either the ``AdfsAuthCodeBackend`` | ||
or the ``AdfsAccessTokenBackend`` (and created in Django, if ``CREATE_NEW_USERS`` is enabled) and | ||
after all claims and groups have been mapped. The signal is sent with the user object, the claims | ||
dictionary, and the ADFS response as arguments for the signal handler. | ||
|
||
To use a signal in your application: | ||
|
||
.. code-block:: python | ||
from django.dispatch import receiver | ||
from django_auth_adfs.signals import post_authenticate | ||
@receiver(post_authenticate) | ||
def handle_post_authenticate(sender, user, claims, adfs_response, **kwargs): | ||
user.do_post_auth_steps(claims, adfs_response) | ||