diff --git a/setup.py b/setup.py index 06e11c4..a3d1b6d 100644 --- a/setup.py +++ b/setup.py @@ -32,5 +32,5 @@ setup( 'Topic :: Software Development :: Libraries :: Python Modules' ], packages=['spaceauth'], - install_requires=['Flask-OAuthlib>=0.9.4', 'Flask-Login>=0.4', 'requests>=2.0', 'blinker'], + install_requires=['authlib', 'Flask-Login>=0.4', 'requests>=2.0', 'blinker'], ) diff --git a/spaceauth/__init__.py b/spaceauth/__init__.py index 932109b..efc7f4f 100644 --- a/spaceauth/__init__.py +++ b/spaceauth/__init__.py @@ -1,5 +1,5 @@ from flask import Blueprint, request, url_for, session, redirect, abort, flash -from flask_oauthlib.client import OAuth, OAuthException +from authlib.integrations.flask_client import OAuth, OAuthError from flask_login import LoginManager, login_user, logout_user, current_user, login_required, UserMixin from spaceauth.caps import cap_required @@ -35,7 +35,7 @@ class SpaceAuth(LoginManager): super(SpaceAuth, self).init_app(app) app.register_blueprint(self.blueprint, url_prefix=url_prefix) - @app.errorhandler(OAuthException) + @app.errorhandler(OAuthError) def errorhandler(err): flash('OAuth error occured', 'error') return redirect('/') @@ -56,7 +56,7 @@ class SpaceAuth(LoginManager): def callback_view_handler(self): resp = self.remote.authorized_response() if resp is None: - raise OAuthException( + raise OAuthError( 'Access denied', type=request.args.get('error')) # TODO encrypt token...?