requests-oauthlib icon indicating copy to clipboard operation
requests-oauthlib copied to clipboard

BROKEN DOCUMENTATION: Backend Flow

Open bostonareahuman opened this issue 1 year ago • 2 comments

URL"

https://requests-oauthlib.readthedocs.io/en/latest/oauth2_workflow.html#backend-application-flow


theauth = HTTPBasicAuth(creds.ClientID,creds.ClientSecret)
client = BackendApplicationClient(creds.ClientID)
bcauth = OAuth2Session(client)
token = bcauth.fetch_token(token_url=tokenendpoint,auth=theauth)

RESPONSE:

"Please supply either code or " "authorization_response parameters." ValueError: Please supply either code or authorization_response parameters.

NO idea what these mean or why they need to be set for just a Backend Client oAuth.

Putting in :

token = bcauth.fetch_token(token_url=tokenendpoint, client_id=creds.ClientID,client_secret=creds.ClientSecret)

Doesn't work either...

What is going with the documentation?

bostonareahuman avatar Jul 10 '24 19:07 bostonareahuman

Encountered the same issue. Does anybody maintain this package?

arpika99 avatar Jun 30 '25 07:06 arpika99

Hello @bostonareahuman and future people who can not copy,

Yesterday I was quite tired and did not notice the typo.

bcauth = OAuth2Session(client) has to be bcauth = OAuth2Session(client=client).

Otherwise the constructor will initialize the Session to the default workflow, which is Web Application Flow.

No further changes are required to the code or docs neither. TIcket can be closed.

arpika99 avatar Jul 01 '25 08:07 arpika99