authlib

Authlib client error: State not equal in request and response

我的未来我决定 提交于 2020-06-17 02:31:36
问题 I'm trying to implement authlib client and server. I took example OAuth2.0 example and making my own client authorization on Flask site following tutorial. This is my code: from flask import Flask, redirect, url_for, session, request from authlib.flask.client import OAuth from authlib.client.errors import OAuthException APP_ID = 'KBtRDO3r2HETjw4TcLznthoj' APP_SECRET = '3g4C6nbJcTIYX3jyCIEmf6KE8h8pzxUhjy6ArlY3AEgj1snv' app = Flask('testa_client') app.debug = True app.secret_key = 'development'

Getting refresh_token with lepture/authlib

雨燕双飞 提交于 2019-12-11 05:59:51
问题 I'm using Authlib, and attempting to get a refresh_token from a Hydra server. I have the following code: from authlib.client import OAuth2Session client_id = "my-client" client_secret = "client secret" token_url = "https://myhydraserver/token" scope = 'openid email profile offline' session = OAuth2Session(client_id, client_secret, scope=scope) token = session.fetch_access_token(token_url) print(token) This prints out {'access_token': 'the-token', 'expires_in': 3599, 'scope': '', 'token_type':

Obtaining Refresh Token from lepture/Authlib through Authorization Code

邮差的信 提交于 2019-12-11 02:34:58
问题 I am trying to develop a simple tool that uses Authlib OAuth2 server to get refresh tokens but example server here does not issue a refresh token. When I print the token I get the following: {'access_token': '....', 'scope': 'profile', 'token_type': 'Bearer', 'expires_in': 864000, 'expires_at': 1532191887} The flow is Authorization code as referred here; first I handle the consent part: client_id = '...' client_secret = '.....' scope = '...' session = OAuth2Session(client_id, client_secret,

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