Questions tagged [authlib]
The authlib tag has no usage guidance.
145
questions
0
votes
0
answers
19
views
Redirect after logging in with authlib
I've used Authlib as part of a Django application to allow users to sign in with their Google account. After the user has signed in, I'd like to redirect users to the page they were originally on. The ...
0
votes
1
answer
28
views
TypeError: 'ResourceProtector' object is not callable
According to the Authlib documentation, there is a built-in approach to use introspection endpoint to validate the given token when resource server has no access to token database:
import requests
...
0
votes
1
answer
59
views
RuntimeError: Missing "jwks_uri" in metadata for flask and Azure AD authlib
I tried login in via Azure AD in airflow container.
I setting de webserver_config.py
OAUTH_PROVIDERS = [
{
'name':'azure', 'token_key':'access_token', 'icon':'fa-windows',
'...
0
votes
0
answers
22
views
Linkedin Login flask_oauthlib.client.OAuthException
I'm trying to make linkedin login, I am getting this issue.
flask_oauthlib.client.OAuthException: Invalid response from linkedin
this is my callback function.
@app.route('/login/authorized')
def ...
0
votes
2
answers
91
views
Airflow 2.2.5 Authlib 1.0.0 Google Login
I'm experiencing problems with Google OAUTH login after updating Airflow to version 2.2.5 and Authlib required as constraint to be at version 1.0.0.
Here my previous webserver_config.py
import os
from ...
1
vote
1
answer
38
views
Python-Youtube-Api : Missing code parameter in response
I am testing the python-youtube package, using the following code:
from pyyoutube import Api
api = Api(
client_id="yes-my-client-id-here-i-know",
client_secret="yes-my-client-...
0
votes
0
answers
131
views
How to setup a Bearer Token Authentication in AsyncOAuth2Client with authlib
I'm calling an API that has a bearer token authentication.
With regular requests package I have successfully implemented it, but then I had to upgrade the class to run concurrent requests.
I found ...
2
votes
1
answer
408
views
Which Timed JSONWebSignature Serializer replacement for itsdangerous is better? pyjwt or authlib
Currently I was using itsdangerous to generate timed json web signature as a token for users to auth and resetpassword etc. Here's the code:
from itsdangerous import TimedJSONWebSignatureSerializer as ...
0
votes
0
answers
43
views
How can I add context to authlib's update_token hook?
My Flask application is using authlib to allow multiple users to connect multiple Google service accounts via OAuth. When those credentials are refreshed, I'd like to automatically save them using the ...
0
votes
0
answers
16
views
Grabbing error mesages from Authlib and passing to flash in Flask
How can I pass authlib.integrations.base_client.errors.OAuthError error messages back to the html in flask via the flash() method?
I have these methods in my class
class NPIListApi:
def __init__(...
0
votes
1
answer
63
views
creating event gives 400 bad request - Google calendar API using AUTHLIB (Python package)
This is my request to create an event (Using AuthLib from PyPi)
resp = google.post(
'https://www.googleapis.com/calendar/v3/calendars/primary/events', data={
'start': {'dateTime': today....
0
votes
1
answer
196
views
Implementing Introspection Validation from Okta using Authlib in Python Flask App
I am trying to implement introspection on client side suing Okta as my authorization server but continuously getting error
{"error": "missing_authorization", "...
0
votes
0
answers
160
views
Parse id_token with Authlib (returned from google-one-tap)
I'm trying to use google-one-tap to authenticate users in the frontend. When a user performs the authentication and it's successful, it returns the following data:
{
"clientId": "--...
0
votes
0
answers
47
views
create a Oauth2.0 server provider using Flask
I want to create an Oauth2.0 server provider to let my flask app interacts with Zapier
any help how to build it i Flask ?
I want to use authlib library with flask
from authlib.integrations.sqla_oauth2 ...
0
votes
0
answers
65
views
Using authlib request client with openid connect in python
Authlib has a nice integration into the popular request module. For instance, for a client credential flow I could do the following:
from authlib.integrations.requests_client import OAuth2Session
...
0
votes
0
answers
39
views
Using SAP STI on Jupyter Lab (offical tutorial), getting "Could not deserialize key data"
I´m just trying the official Tutorial with the STI Feature of SAP BTP.
I just work on the 'Classification_demo' in Jupyter Lab.
STI_BASE_DIR = Path.cwd().parent
config_file_path = "../default_key....
0
votes
0
answers
47
views
Authlib httpx client do not fecth token automatically
I have tried using authlib httpx client with the following configuration
authn_data = {
"token_endpoint": f"https://my/iam/url/protocol/openid-connect/token",
"...
3
votes
1
answer
209
views
How to save and reuse tokens with authlib
I'm very beginner with authlib and trying to understand its concepts.
I try to understand, how can I save and reuse fetched tokens with authlib.
I created small FastAPI project:
from fastapi import ...
3
votes
1
answer
215
views
mismatching_state: CSRF Warning! State not equal in request and response in fastapi
I am trying to integrate gitlab in my fastapi project however, this problem is killing me. I am using authlib for it. The process of gitlab integration is when a user hits a connect button then gitlab ...
0
votes
0
answers
113
views
One-login Apache Superset integration
I have integrated one-login to superset, using helm chart. Here is part of the configuration that does the authentication via one-login:
configOverrides:
enable_oauth: |
# This will make sure ...
0
votes
0
answers
101
views
AuthLib auth not set after fetch_token()
I may have failed to read the docs but I am expecting that after fetch_token the client auth should be set and usable by client.get/post/request, etc. Could someone help clarify this for me?
Here is ...
0
votes
0
answers
15
views
Auth Lib interface changed after upgrade?
My Angular app compiled ok, but when I ran it, it didn't fetch all the links, some worked though and gave me this error:
ERROR TypeError: auth_lib_index__WEBPACK_IMPORTED_MODULE_17__.AuthInterceptor ...
0
votes
1
answer
168
views
Why is the redirect_uri of my gitlab as an OAuth2 provider http instead of https?
I want to configure my deployment of superset so that users can signing using gitlab as OAuth2 provider.
Superset is a flask app that uses authlib to enable OAuth2 (https://superset.apache.org/docs/...
0
votes
1
answer
350
views
How to configure Keycloak for Superset with Authlib?
I'm trying to use Authlib to setup Keycloak as SSO for Superset. Everything works fine up until when user is redirected back to Superset. Then this error occured:
authlib.integrations.base_client....
1
vote
1
answer
87
views
How to turn off SSL verification for Authlib client with HTTPX / Starlette?
I can't seem to find a way to make Authlib / HTTPS respect the self-signed certs no matter how hard I try, so I want to turn SSL verification off when making requests as the OAuth client. How can I do ...
4
votes
0
answers
539
views
Starlette session state clearing
some strange behaviour I've found when trying to clear Starlette sessions state (using starlette.middleware.sessions.SessionMiddleware) while working through some OAuth/0Auth authentication examples.
...
0
votes
0
answers
93
views
How to validate and introspect a user provided Oauth token (eg. in Authorisation header) with authlib
I have a public client (SPA), that acquires the OAuth token via PKCE.
The SPA then relays the auth token in the headers to an API server, who will validate the token, and either fetch additional ...
0
votes
0
answers
115
views
Snowflake OAuth Flask
I'm new to to OAuth and trying to utilize the new snowflake API https://api.developers.snowflake.com/#intro .
I tried to obtain the access token with calls I got from the Authlib python library ...
0
votes
0
answers
64
views
Problem while implementing my own OpenID provider and client
I am using authlib library(python) which is for client side and Oauth2 for the serverside.
after resp = oauth.get('userinfo') step my client side code stops and I get this error shown in the browser:
{...
1
vote
1
answer
371
views
OAuth2 Session - How to add multiple scopes?
I am trying to add multiple scopes but it seems instead of adding spaces in the url, it adds +. I'm not sure how to ensure a space is added. I'm storing the scopes in a list.
CALLBACK_URL = 'https://...
2
votes
0
answers
372
views
Authlib Flask Client - How to validate and refresh the access token
I have been trying to integrate Authlib Flask Client to achieve the OIDC via Google OIDC. I am using Flask SQLAlchemy, and everything is working perfectly fine. The only problem is I am unable to ...
1
vote
1
answer
583
views
401 Client Error: Unauthorized url. Flask python
I have a program that Authenticate with API and when logged in search by Id in contacts on this API.
logging in works fine but when I try to find contact this error happen:
401 Client Error: ...
1
vote
2
answers
572
views
Does authorize_access_token also verify an id token?
For retrieving an OAuth / OpenID Connect token, the function authorize_access_token is used in the authlib docs. OAuth providers like Google strongly advise to manually verify these tokens, for ...
0
votes
0
answers
61
views
Python Import Error : Unable to to import JWTBearerToken from authlib.oauth2.rfc7523
I am trying to use JWTBearerToken from authlib.oauth2.rfc7523. However, I have encountered import error when trying to import JWTBearerToken:
Create a virtual environment and install authlib
$ pyenv ...
0
votes
1
answer
142
views
authlib.integrations.base_client.errors.MismatchingStateError
Trying to get a token for tradestation with flask_client.
baseurl='https://sim-api.tradestation.com/v2'
oauth.register(
name='tradestation',
client_id=api_key,
client_secret=api_secret,
...
0
votes
0
answers
313
views
Does Python Authlib support decoding AWS Cognito access / id tokens?
I am new to the authlib library and wanted to figure out how to verify an AWS Cognito access token using authlib without installing extra additional library dependencies. I am using openidc auth code ...
0
votes
1
answer
359
views
Examples of using authlib's httpx client asynchronously
There are several examples here of using an httpx client instead of a requests based session with the popular oauth lib, authlib
However in those examples, they don't show how to properly open and ...
3
votes
0
answers
459
views
Python Authlib : How To Resolve Auth Code Challenge And Verify Tokens Stored In HTTP Only Session Cookie Of Protected Endpoint?
After reading the documentation I am struggling to understand how to use Authlib to implement Authorize Code Flow for an OpenID Connect provider. After reading the documentation I have had a go at ...
1
vote
0
answers
137
views
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 ...
0
votes
1
answer
105
views
What is the API contract for OAuth2Session update_token callback?
The OAuth 2 client documentation on refresh & autoupdate token is unclear on the semantics for the various parameters.
When are refresh_token & access_token passed in?
What are their values ...
1
vote
0
answers
107
views
Authlib - Oauth2 Server - how to accept json client credentials?
I'm doing an integration with a company, and have little control over their client side. code In this case, I have to implement an Oauth2 server and support their specific integration. They want to ...
0
votes
1
answer
400
views
Authlib Token Validator using Remote Authentication Server
The Authlib documentation describes how a resource server can validate the auth_token from the client implementing a BearerTokenValidator as such:
class MyBearerTokenValidator(BearerTokenValidator)...
1
vote
0
answers
185
views
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 ...
0
votes
1
answer
533
views
In authlib, does authorize_access_token require the explicit passing of client_id and client_secret?
I am using authlib with a pretty standard OAuth2 flow.
import pickle
import json
import os.path
from requests.models import Response
from authlib.integrations.flask_client import OAuth, OAuthError
...
0
votes
1
answer
123
views
How can I send Authlib requests through a proxy?
With requests I can make a request through a proxy:
import requests
proxies = {
"http": "http://proxy.yourorg.com:80",
"https": "http://proxy.yourorg.com:80&...
0
votes
0
answers
276
views
Authlib: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
I'm using this blog post from Authlib's blog to add google oauth to a FastAPI app. I'm from Iran and Everything works fine when my VPN is on, but when it's off and I try to login to app with google ...
0
votes
1
answer
145
views
Python requests authlib - SSLCertVerificationError CERTIFICATE_VERIFY_FAILED
How to make Autlib/ requests work with self signed certificates on Windows?
There is documentation for how to use an environment variable to point to a CA bundle, but in my case I have struggled to ...
1
vote
1
answer
812
views
Python authlib flask - how to revoke token / logout
In my current situation my flask app could be the only one using the Oauth server.
In that case I'd like to have my logout button actually revoke the access token.
But how to do that using the authlib ...
0
votes
1
answer
226
views
Authlib's Azure login throws an invalid_claim: Invalid claim "iss"
I am currently login with Google with no problems, using Authlib for my Starlette app, but Azure throws this invalid claim "iss" error when doing:
await client.parse_id_token(request, token)
...
2
votes
1
answer
974
views
Python authlib flask - how to handle refresh token?
I only need oauth2 for login so far, but I feel that to be reasonably complete, my app should still handle refresh tokens.
I'm fairly new to oauth, so here is my understanding:
By keeping access token ...