apicrud.auth.oauth2

oauth2

created 26-mar-2021 by richb@instantlinux.net

Classes

OAuth2([func_send, roles_from])

OAuth2 for Session Authorization

class apicrud.auth.oauth2.OAuth2(func_send=None, roles_from=None)

OAuth2 for Session Authorization

Parameters
  • func_send (function) – name of function for sending message

  • roles_from (obj) – model for which to look up authorizations

callback(method, code=None, state=None)

Callback from 3rd-party OAuth2 provider auth

Parse the response, look up the account based on email address, and pass control to SessionAuth._login_accepted

Parameters
  • method (str) – provider name, such as google

  • code (str) – validation code from provider

  • state (str) – provider state