make 'oauth_client' more flexible
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- r
- Domain
- authentication
Research direction
Start in R/oauth-client.R at oauth_client and oauth_client_get_token, using the linked locations as entry points; review related issue #435 for context. Determine how the proxy setting should apply across authorization, device, and client-credentials flows, then verify that token requests use the configured proxy when present and remain unchanged otherwise.
Written by the indexing model from the issue text.
Description
We have a use case, where depending on the system the code runs, it uses OAuth2 via authorisation flow, device flow or client credentials, with proxy and without proxy. In order to write simple code that works in any of these cases, would it make sense to add 'proxy' argument to 'oauth_client'
https://github.com/r-lib/httr2/blob/f52f4b92159fda233e3de7b0566d67c51bf5a282/R/oauth-client.R#L42
oauth_client <- function(
id,
token_url,
secret = NULL,
key = NULL,
auth = c("body", "header", "jwt_sig"),
auth_params = list(),
name = hash(id),
proxy = NULL
) {
Then, in oauth_client_get_token one would do something like
https://github.com/r-lib/httr2/blob/f52f4b92159fda233e3de7b0566d67c51bf5a282/R/oauth-client.R#L243
if(!is.null(client$proxy))
req <- req_proxy(req, client$proxy)
We would then create the oauth_client with
client <- oauth_client(
id = "28acfec0674bb3da9f38",
token_url = "https://github.com/login/oauth/access_token",
name = "oauth-test-2",
proxy = curl::ie_get_proxy_for_url()
)
related #435
At the moment we use AzureAuth and httr::use_proxy.
Thanks
- Dominant language
- R
- Stars
- 270
- Forks
- 91
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 3
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from r-lib/httr2
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
Difficulty 5/5 Over a week Newbie friendliness 38/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
r-lib/pkgdepends#485 · 3 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
beginners blocker
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enviPathR OpenBuild Error Build OK Build Warning policies-accepted pre-review precheck-passed
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Bioconductor/BiocContributions#207 · 6 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
datacarpentry/semester-biology#1255 ·