def login(self, request):
        form = self.get_login_form()

        # some login systems require an external login URL.  For example
        # the one we use as Plurk.
        try:
            rv = self.before_login(request)
            if rv is not None:
                return rv
        except LoginUnsucessful, e:
            form.add_error(unicode(e))

        # only validate if the before_login handler did not already cause
        # an error.  In that case there is not much win in validating
        # twice, it would clear the error added.
        if form.is_valid and request.method == 'POST' and form.validate():
            try:
                rv = self.perform_login(request, **form.data)
            except LoginUnsucessful, e:
                form.add_error(unicode(e))
            else:
                session.commit()
                if rv is not None:
                    return rv
                request.flash(_(u'You are now logged in.'))
                return form.redirect('kb.overview')

        return self.render_login_template(request, form)
Ensure client is authorized to redirect to the redirect_uri.
dataset/ETHPy150Open mitsuhiko/solace/solace/auth.py/AuthSystemBase.login--crossover with--dataset/ETHPy150Open codalab/codalab-cli/codalab/server/oauth2_provider.py/OAuth2RequestValidator.confirm_redirect_uri