def oid_login_handler(self, f, oid):
        """
        Hackish method to make use of oid.login_handler decorator.
        """
        from flask_openid import OpenIDResponse, SessionWrapper
        from openid.consumer.consumer import CANCEL, Consumer, SUCCESS

        if request.args.get("openid_complete") != "yes":
            return f(False)
        consumer = Consumer(SessionWrapper(self), oid.store_factory())
        openid_response = consumer.complete(
            request.args.to_dict(), oid.get_current_url()
        )
        if openid_response.status == SUCCESS:
            return self.after_login(OpenIDResponse(openid_response, []))
        elif openid_response.status == CANCEL:
            oid.signal_error("The request was cancelled")
            return redirect(oid.get_current_url())
        oid.signal_error("OpenID authentication error")
        return redirect(oid.get_current_url())

        Hackish method to make use of oid.login_handler decorator.
        
flask_appbuilder/security/registerviews.py