Questions tagged [authlib]

124 questions
7
votes
2 answers

Python OAuth2 server with social networks for a RESTfull API

I'm trying to implement OAuth2 server for a RESTfull API with a login option through social platforms (Github, Facebook, Instagram) using Python and Falcon web framework. But I've struggled to understand how this thing should work. My current…
Vit D
  • 143
  • 1
  • 5
  • 23
5
votes
1 answer

Flask-oauthlib or authlib in production?

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…
ukosteopath
  • 343
  • 5
  • 14
4
votes
1 answer

Authlib client error: State not equal in request and response

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…
Mikhail Kashkin
  • 1,401
  • 14
  • 26
3
votes
1 answer

ImportError: cannot import name 'bytes_type' from 'oauthlib.common'

I am updating airflow from 1.10.5 to 1.10.10. I am getting the following error in webserver when using google OAuth Traceback (most recent call last): File "/home/airflow/.local/bin/airflow", line 37, in args.func(args) File…
Ayush Chauhan
  • 442
  • 5
  • 19
3
votes
1 answer

Could we make OAuth2Session refresh token x seconds before it expires?

This question relates to authlib python module: I'm using an authlib OAuth2Session to trigger a lot of requests to an API. I provided a refresh_token_url to my OAuth2Session, so that the access_token is seamlessly refreshed when expired. Most of the…
Géraud
  • 1,505
  • 2
  • 14
  • 18
3
votes
1 answer

Python 3.7 Authlib UnsupportedAlgorithmError

I have this issue on Ubuntu 18.04 in the Docker. When I develop this app on macOS there is no such error. I build image with this Dockerfile: https://pastebin.com/rG32a0dv requirements.txt:…
andre487
  • 1,221
  • 2
  • 16
  • 26
3
votes
2 answers

Update/convert 'flask_oauthlib.client' to 'authlib.flask.client' - Microsoft Graph v2 access without a user

My goal is to implement this: https://github.com/Azure-Samples/active-directory-python-flask-graphapi-web-v2 With the newer Authlib library. https://github.com/lepture/authlib I need an app that authenticates with a certificate (no user login) and…
dev01
  • 31
  • 1
3
votes
1 answer

Obtaining Refresh Token from lepture/Authlib through Authorization Code

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':…
fturkmen
  • 324
  • 1
  • 10
3
votes
0 answers

Migration guide flask-oauthlib to authlib

I'm trying to migrate a legacy app that uses Flask-OAuth to authlib. The documentation of authlib is fairly decent, but what would be helpful is a migration guide, because I don't really know what parts of flask-oauthlib are similar to parts of…
James O'Brien
  • 1,686
  • 1
  • 13
  • 10
2
votes
0 answers

Python Flask Rest API Authorization using OAUTH 2.0 access token from an external Third Party OAUTH 2.0 Authorization Server

I have built a rest api backend using python 3.7 and flask. I would like to add authorization to my api end-points. These apis would be called by another application (machine to machine flow). The calling application is expected to send an OAuth 2.0…
2
votes
1 answer

Obtaining and storing refresh token using Authlib with flask

I'm using the authlib https://github.com/lepture/authlib obtain user authentication to their data, so a daily offline scheduler can download some data on the behalf of the user. I first register the client: google = oauth.register( 'google', …
Sharethefun
  • 764
  • 2
  • 16
  • 32
2
votes
1 answer

Authlib for Flask App getting param_error

I'm using the Authlib module to test OAuth2 integration. I made a simple Flask app and am trying to Authorize with the Untappd API (https://untappd.com/api/docs#authentication). Following the guidelines of the Authlib Flask module…
Kyle Fennell
  • 201
  • 1
  • 6
2
votes
1 answer

Getting refresh_token with lepture/authlib

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 =…
ashic
  • 5,932
  • 3
  • 28
  • 47
1
vote
0 answers

How to add custom Header in Authlib on Django

I would need some of your help adapting Authlib with Django. I'm trying to develop a Django app using OpenId and Authlib to connect my users and facing an issue with the access token, the issue invalid_client occurs. Using Postman I found out that…
lcarne
  • 31
  • 3
1
vote
0 answers

Python AuthLib Resource Server using a BearerTokenValidator with Multiple Strategies

I have a resource server (built with Flask, but not sure if that matters right now) that has a RESTful API. The API is secured with OAuth2 access tokens and scopes. Currently the access tokens are opaque (not JWT) and the resource server needs to…
niltz
  • 782
  • 8
  • 26
1
2 3
8 9