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

update demo/oauth2-azure.r to oauth2/v2.0 #754

Open
klin333 opened this issue Aug 23, 2024 · 0 comments
Open

update demo/oauth2-azure.r to oauth2/v2.0 #754

klin333 opened this issue Aug 23, 2024 · 0 comments

Comments

@klin333
Copy link

klin333 commented Aug 23, 2024

In the azure demo, it suggests using a legacy endpoint.

httr/demo/oauth2-azure.r

Lines 18 to 24 in df11e21

# Obtain OAuth2 endpoint settings for azure:
# This uses the "common" endpoint.
# To use a tenant url, create an
# oauth_endpoint(authorize = "https://login.windows.net/<tenant_id>/oauth2/authorize",
# access = "https://login.windows.net/<tenant_id>/oauth2/token")
# with <tenant_id> replaced by your endpoint ID.
azure_endpoint <- oauth_endpoints("azure")

It needs to be updated to the below, as outlined in Microsoft guide https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-auth-code-flow

endpoint <- httr::oauth_endpoint(
  authorize = sprintf("https://login.windows.net/%s/oauth2/v2.0/authorize", tenant_id),  # changed here by adding /v2.0/
  access = sprintf("https://login.windows.net/%s/oauth2/v2.0/token", tenant_id))

In addition httr::oauth_endpoints("azure") gives "https://login.windows.net/common/oauth2/authorize", which is no longer supported since 2018 I believe.

I can confirm this change is required.

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

No branches or pull requests

1 participant