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

Add PKCE support #77

Open
mattmalcher opened this issue Mar 9, 2023 · 2 comments
Open

Add PKCE support #77

mattmalcher opened this issue Mar 9, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@mattmalcher
Copy link

Curious about the current status of this package, have a requirement to authenticate to Azure AD using Auth Code + PKCE flow which is not supported as-is.

Basically looking to understand:

  • chances of someone adding pkce flow / moving this package to httr2
  • chances of being able to make a pull request & have it accepted, and update the package on CRAN

From what I can tell hongooi73 has moved on from microsoft.

I can see there is a branch and issue working on implementing httr2, but the last activity is Oct 21.

It doesn't look like pull requests are being accepted #71

Is the best approach to fork?

@hongooi73
Copy link
Collaborator

Note I'm still around, although I've been less active recently. Do you have specific functionality in httr2 that isn't present in the current package?

@mattmalcher
Copy link
Author

Glad to hear it :) Sorry if I'm misunderstanding the question, but:

The functionality that is in httr2, that I don't believe is in the current version of AzureAuth is the ability to use the auth code + PKCE flow.

My reason for thinking this was the lack of a flag for PKCE and that I understand the current package is based on httr's OAuth implementation, which while it supports auth code, does not support auth code + pkce. (r-lib/httr#705).

Because I am required to use PKCE I am using something like the following to construct my graph requests manually:

    client <- httr2::oauth_client(
      id = client_id,
      token_url = paste0(
        "https://login.microsoftonline.com/", tenant_id, "/oauth2/v2.0/token"
      )
    )

    httr2::req_oauth_auth_code(
      req,
      client = client, 
      auth_url = auth_url, 
      **pkce=TRUE**
    ) 

I have used the httr2 branch you put together successfully (thank you!), but its harder to use where I need to use it, while it remains as a branch, not in CRAN.

I guess I was hoping it might be possible to get that branch merged in, if not, no worries and thanks either way, really appreciate that this package exists and feel cheeky asking for more!

@hongooi73 hongooi73 changed the title Clarify status of package Add PKCE support Feb 22, 2024
@hongooi73 hongooi73 added the enhancement New feature or request label Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants