Questions tagged [requests-oauthlib]
32 questions
34
votes
0 answers
Google OAuth 2 Refresh Token is Missing for Web App but Present for localhost
Problem: Missing OAuth 2 Refresh Token.
The problem is that the localhost version receives a Refresh Token as part of the granted token but the same code running in GCE does not.
Details:
I have written a Python Flask application that implements…

John Hanley
- 74,467
- 6
- 95
- 159
4
votes
1 answer
(How) can I send (prepared) requests with requests.OAuth2Session?
When running the following (while replacing example.com with our API, obviously)
req = Request('GET', 'https://example.com')
# client is a customized OAuth2Session
client.authorize(self.username, self.password,…

hielsnoppe
- 2,819
- 3
- 31
- 56
3
votes
0 answers
How to use a tempfile for certificate based authentication?
I want to fetch an OAuth token using client credentials with an X.509 certificate. I am using requests-oauthlib with the OAuth2 backend application flow. I'm getting the certificate and key at runtime from the framework I'm running in as strings not…

Kai Roesner
- 429
- 3
- 17
3
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
- 804
- 3
- 17
- 33
3
votes
1 answer
Flask python setup: oauthlib version problems while installing
I am extremely new to flask - just setting it up now for following a tutorial on how to build a web app including logins.
Some of the packages I need for the tutorial are requests-oauthlib,flask-oauthlib and oauthlib.
I came across this problem…

SCool
- 3,104
- 4
- 21
- 49
2
votes
0 answers
Does requests_oauthlib cache by default, and should I even cache?
I'm authorizing people on my site with Discord. I don't want to spam their API however, does the .get method in requests_oauthlib cache the response so it doesn't send duplicate requests?
If not, any way to go about doing this and is it recommended…

JohnyTheCarrot
- 103
- 7
1
vote
1 answer
Python requests_oauthlib OAUTH V2 BackendCleint fetch_token() error
I am attempting to use the BackendClient workflow for creating a OATH V2.0 connection. Using the requests_oauthlib package. Documentation is at: https://requests-oauthlib.readthedocs.io/en/latest/oauth2_workflow.html#backend-application-flow
The…

Dr.YSG
- 7,171
- 22
- 81
- 139
1
vote
0 answers
Can't change token_endpoint_auth_method in python's requests_oauthlib (Oauth2Session)
According to the docs for requests_oauthlib Oauth2Session you should be able to change the token endpoint method from client_secret_basic, which is the default method, to client_secret_post in the following way
client =…

bart cubrich
- 1,184
- 1
- 14
- 41
1
vote
1 answer
How to login by oauth to third party app with python
I am having trouble authenticating against a web service that has Oauth provided by google.
Basically, I want to login with my google account to a web page to do some scraping on it.
As the web service is not mine, I don't have the app secret_key,…

GonzaloN
- 45
- 7
1
vote
3 answers
Installing python libaries on Anaconda on Mac
Sorry, I am very new to Python, this may be a silly question.
I have installed Anaconda on Mac, and have been using basis libraries like pandas. When I try to install oauthlib library by using : pip install oauthlib, on Ipython, I get the error…

Avi
- 11
- 2
1
vote
2 answers
Include authorization in a oauth2session for requests-oauthlib
From reading various documents it seems like authorization is optionally required by oauth2 providers for refresh token requests. I'm working with the FitBit API that appears to require authorization.
I'm following the instructions here for…

Jimbo
- 2,886
- 2
- 29
- 45
1
vote
1 answer
Upwork API authorization url returns 'Unauthorized' despite API key being active
I try to connect to the Upwork API with the Python client.
My project type is 'desktop', the key is 'active'.
However, the authentication url returns 403 and, in a browser, it shows an 'Unauthorized' message.
Here is the code, which simply tries to…

nocibambi
- 2,065
- 1
- 16
- 22
1
vote
2 answers
How to add http headers along with data to send a POST request to an API endpoint using Oauth2Session (requests_oauthlib)?
I have a python code like this to interact with an API
from oauthlib.oauth2 import BackendApplicationClient
from requests_oauthlib import OAuth2Session
import json
from pprint import pprint
key = "[SOME_KEY]" # FROM API PROVIDER
secret =…

Kiran Racherla
- 219
- 3
- 12
1
vote
1 answer
Different scopes than I requested with requests_oauthlib in Microsoft Graph
I am creating a Python script to use Microsoft Graph API services using the requests_oauthlib library. I am able to create successfully an OAuth2.0 session, get an authorization URL to open in an internet browser window to authenticate, and then I…

Noah Random
- 48
- 6
0
votes
0 answers
Invalid Grant Error (invalid_grant) Malformed auth code
i wanted to test google login view of my own i am without a front so i just clicked on this…