apicrud.auth.totp_func

totp_func

created 5-apr-2021 by richb@instantlinux.net

Functions

login(username, otp[, redis_conn])

Log in with TOTP; a prior login must have succeeded and set up a session with the account_id and pendingotp auth, or with an apikey.

apicrud.auth.totp_func.login(username, otp, redis_conn=None)

Log in with TOTP; a prior login must have succeeded and set up a session with the account_id and pendingotp auth, or with an apikey. If otp matches, this passes a sqlalchemy account record back for further processing by SessionAuth.login_accepted.

Parameters:
  • username (str) – username or identity

  • otp (str) – 6 or 8-digit one-time password

  • redis_conn (obj) – connection to redis

Returns:

4 items

dict with error message http status (200 if OK) headers (Set-Cookie) account (sqlalchemy query object)

Return type:

tuple