'Prepare to handle a login request.
This method replaces social_core.actions.do_auth and must be kept in sync
with any upstream changes in that method. In the current version of
the upstream, this means replacing the logic to populate the session
from request parameters, and not calling backend.start() to avoid
an unwanted redirect to the non-existent login page.'

def start(self):

    validated_lti_params = self.get_validated_lti_params(self.strategy)
    self.strategy.session_setdefault('auth_entry', 'login')
    if (not validated_lti_params):
        self.strategy.session_set(LTI_PARAMS_KEY, None)
        raise AuthFailed(self, 'LTI    parameters    could    not    be    validated.')
    else:
        self.strategy.session_set(LTI_PARAMS_KEY, validated_lti_params)
    for field_name in self.setting('FIELDS_STORED_IN_SESSION', []):
        if (('custom_tpa_' + field_name) in validated_lti_params):
            self.strategy.session_set(field_name, validated_lti_params[('custom_tpa_' + field_name)])
    if (('custom_tpa_' + REDIRECT_FIELD_NAME) in validated_lti_params):
        redirect_uri = validated_lti_params[('custom_tpa_' + REDIRECT_FIELD_NAME)]
        if self.setting('SANITIZE_REDIRECTS', True):
            redirect_uri = sanitize_redirect(self.strategy.request_host(), redirect_uri)
        self.strategy.session_set(REDIRECT_FIELD_NAME, (redirect_uri or self.setting('LOGIN_REDIRECT_URL')))
