Skip to content

handlers.email_addr

fluffy edited this page Jul 13, 2019 · 2 revisions

authl.handlers.email_addr: Email validation handler

This package provides a handler called EmailAddress which allows users to authenticate via a magic link sent to them via email.

Simple configuration

def from_config(config, secret_key):
    """ Generate an EmailAddress handler from the provided configuration dictionary.

    Possible configuration values (all optional unless specified):

    SMTP_HOST -- the email host (required)
    SMTP_PORT -- the email port (required)
    SMTP_USE_SSL -- whether to use SSL for the SMTP connection
    SMTP_USERNAME -- the username to use with the SMTP server
    SMTP_PASSWORD -- the password to use with the SMTP server
    EMAIL_FROM -- the From: address to use when sending an email (required)
    EMAIL_SUBJECT -- the Subject: to use for a login email (required)
    EMAIL_LOGIN_TIMEOUT -- How long (in seconds) the user has to follow the login link
    EMAIL_CHECK_MESSAGE -- The message to send back to the user
    EMAIL_TEMPLATE_FILE -- A path to a text file for the email message
    """

Complex configuration

There are more complex options for providing your own sendmail routines et al but those will have to wait until I have a better documentation system in place.