Signals
Django-oauth-toolkit sends messages to various signals, depending on the action that has been triggered.
You can easily import signals from oauth2_provider.signals and attach your own listeners.
For example:
from oauth2_provider.signals import app_authorized
def handle_app_authorized(sender, request, token, **kwargs):
print('App {} was authorized'.format(token.application.name))
app_authorized.connect(handle_app_authorized)
Currently supported signals are:
- oauth2_provider.signals.app_authorized - fired once an oauth code has been authorized and an access token has been granted
当前内容版权归 readthedocs 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 readthedocs .