Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing of access_token key from response JSON for OAUTH2 #216

Open
wants to merge 8 commits into
base: 3_5
Choose a base branch
from

Conversation

prajwaltr93
Copy link
Contributor

@prajwaltr93 prajwaltr93 commented Mar 25, 2023

when using OAUTH2 as STORAGE_API with use of credentials such as client_id, client_secret etc, access_token is first fetched and further requests use fetched token to perform request until it expires.

regex used to parse response and get access_token had an extra trailing space, which is not present in response causing amanda to not parse it hence sending empty access_token i.e Authorization : Bearer (null).

this fixes parsing, further enables users using OAUTH2 as authentication mechanism.

fixes #214.

Changes:

  • Fix regex's parsing response to get valid set of credentials

  • Testing Changes.

  • account of no or more trailing space in regex's

  • make setting HTTP requests to 1.1 if user wishes to, by allowing settings another configuration in .conf

@prajwaltr93 prajwaltr93 force-pushed the 3_5.fix_access_token_oauth2 branch 2 times, most recently from 6c998e9 to 2daf8bb Compare March 25, 2023 03:28
- was not setting expires_in properly, causing fetch of access_token
for every other request

TODO: make use of HTTP/1.1 configurable
@prajwaltr93 prajwaltr93 changed the title Draft: Fix parsing of access_token key from response JSON for OAUTH2 Fix parsing of access_token key from response JSON for OAUTH2 May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant