flask-oauthlib

How to use a refresh_token to get a new access_token (using Flask-OAuthLib)?

被刻印的时光 ゝ 提交于 2020-01-23 06:32:46
问题 I'm building a website + backend with the FLask Framework in which I use Flask-OAuthlib to authenticate with google. After authentication, the backend needs to regularly scan the user his Gmail. So currently users can authenticate my app and I store the access_token and the refresh_token . The access_token expires after one hour, so within that one hour I can get the userinfo like so: google = oauthManager.remote_app( 'google', consumer_key='xxxxxxxxx.apps.googleusercontent.com', consumer

How to use a refresh_token to get a new access_token (using Flask-OAuthLib)?

▼魔方 西西 提交于 2020-01-23 06:32:13
问题 I'm building a website + backend with the FLask Framework in which I use Flask-OAuthlib to authenticate with google. After authentication, the backend needs to regularly scan the user his Gmail. So currently users can authenticate my app and I store the access_token and the refresh_token . The access_token expires after one hour, so within that one hour I can get the userinfo like so: google = oauthManager.remote_app( 'google', consumer_key='xxxxxxxxx.apps.googleusercontent.com', consumer

Google OAuth with Flask-Dance (always redirect to “choose account” google page)

非 Y 不嫁゛ 提交于 2019-12-22 05:05:22
问题 I have an app written with Flask and try to use Flask-Dance (Flask-Dance Docs - Google Example) to enable Google OAuth. I got the following setup: from flask import redirect, url_for, jsonify, Blueprint from flask_dance.contrib.google import make_google_blueprint, google from server.app import app # Internal auth blueprint auth = Blueprint('auth', __name__, url_prefix='/auth') # Google auth blueprint google_login = make_google_blueprint( client_id=app.config['GOOGLE_CLIENT_ID'], client_secret

Flask-Dance Error: Scope has changed

纵然是瞬间 提交于 2019-12-11 13:15:26
问题 I am using flask-dance to authenticate to Google's servers. Config for flask-dance: from flask.ext.dance.contrib.google import make_google_blueprint google_blueprint = make_google_blueprint ( client_id=app.config['GOOGLE']['client_id'], client_secret=app.config['GOOGLE']['client_secret'], scope=["profile", "email"], redirect_to="main.index", login_url="/", authorized_url="/authorized", ) app.register_blueprint(google_blueprint,url_prefix="/login") However, I am getting Warning: Scope has

Redirect to previous URL after OAuth login is completed (flask-dance)

只谈情不闲聊 提交于 2019-12-11 06:34:48
问题 I am developing a Flask application that allows the user to login using OAuth (with Github as a provider), and the flask-dance library. For some reason I am not able to redirect, after a successful login, to the page from which I sent the user to the login page. When the user tries to connect to, e.g., http://localhost:6675/examples/tutorial.first/, the user is redirected to the login page, showing in the URL the page we should redirect to (http://localhost:6675/login?next=%2Fexamples

Resource Owner Password Credentials Grant - Public Client

邮差的信 提交于 2019-12-10 11:48:22
问题 I am trying to implement Oauth2 for a website using Python oauthlib. I have decided that I would like to use the grant type 'ResourceOwnerPasswordCredentialsGrant', this is because the website and the API are my own and will not be open to third parties. In 'resource_owner_password_credentials.py' why is 'client_authentication_required' hardcoded to return 'True'? Do I need to authenticate my client (website)? From my understanding this would be a 'public' and not a confidential client. 回答1:

Flask-oauthlib or authlib in production?

喜欢而已 提交于 2019-12-10 10:22:48
问题 I just got flask-oauthlib working in a website I'm building. However, I noticed that the front page of the project has a warning to use authlib instead. If you use flask-oauthlib in production are you planning to migrate to authlib? Is anyone aware of a simple project repo where this migration has been done? I'd very much appreciate glancing at something. flask-oauthlib page, note the warning: https://flask-oauthlib.readthedocs.io/en/latest/ 回答1: Answering your question at first: This project

Flask-oauthlib or authlib in production?

醉酒当歌 提交于 2019-12-05 18:44:50
I just got flask-oauthlib working in a website I'm building. However, I noticed that the front page of the project has a warning to use authlib instead. If you use flask-oauthlib in production are you planning to migrate to authlib? Is anyone aware of a simple project repo where this migration has been done? I'd very much appreciate glancing at something. flask-oauthlib page, note the warning: https://flask-oauthlib.readthedocs.io/en/latest/ Answering your question at first: This project has migrated from Flask-OAuthlib to Authlib: https://github.com/opendatateam/udata/pull/1434 And then

How to use a refresh_token to get a new access_token (using Flask-OAuthLib)?

雨燕双飞 提交于 2019-12-05 08:55:28
I'm building a website + backend with the FLask Framework in which I use Flask-OAuthlib to authenticate with google. After authentication, the backend needs to regularly scan the user his Gmail. So currently users can authenticate my app and I store the access_token and the refresh_token . The access_token expires after one hour, so within that one hour I can get the userinfo like so: google = oauthManager.remote_app( 'google', consumer_key='xxxxxxxxx.apps.googleusercontent.com', consumer_secret='xxxxxxxxx', request_token_params={ 'scope': ['https://www.googleapis.com/auth/userinfo.email',

Google OAuth with Flask-Dance (always redirect to “choose account” google page)

♀尐吖头ヾ 提交于 2019-12-05 05:35:45
I have an app written with Flask and try to use Flask-Dance ( Flask-Dance Docs - Google Example ) to enable Google OAuth. I got the following setup: from flask import redirect, url_for, jsonify, Blueprint from flask_dance.contrib.google import make_google_blueprint, google from server.app import app # Internal auth blueprint auth = Blueprint('auth', __name__, url_prefix='/auth') # Google auth blueprint google_login = make_google_blueprint( client_id=app.config['GOOGLE_CLIENT_ID'], client_secret=app.config['GOOGLE_CLIENT_SECRET'], scope=['profile', 'email'] ) def auth_google_view(): """