-
Notifications
You must be signed in to change notification settings - Fork 85
Open
Description
httr2/R/oauth-flow-auth-code.R
Line 186 in c7d4a86
| redirect_uri = redirect_uri, |
When performing an "oauth2 code flow" to Azure, and not setting the argument redirect_uri (using the default "http://localhost"), Azure returns error AADSTS500112.
Error in outh_flow_auth_codeO):
! OAth failure [invalid_client]
AADSTS500112: The reply address "http://localhost' does not match the reply address
'http://localhost:18894/° provided when requesting Authorization code.
When oauth_flow_auth_code uses the default redirect URI from oauth_redirect_uri() (and it returns "http://localhost/"), the subsequent call to normalize_redirect_uri() adds a random port, creating a mismatch between the authorization and token requests.
This causes OAuth providers (e.g., Azure AD) to reject the token exchange with "reply address does not match" errors, as the redirect$uri in the first request differs from the second redirects_url.
Metadata
Metadata
Assignees
Labels
No labels