Skip to content

[flutter_appauth][flutter_appauth_platform_interface] Add support for proxy redirect URLs#652

Open
luis901101 wants to merge 5 commits into
MaikuB:masterfrom
luis901101:master
Open

[flutter_appauth][flutter_appauth_platform_interface] Add support for proxy redirect URLs#652
luis901101 wants to merge 5 commits into
MaikuB:masterfrom
luis901101:master

Conversation

@luis901101
Copy link
Copy Markdown

Add support for proxy redirect URLs

What this PR does

Adds an optional proxyRedirectUrl parameter to AuthorizationRequest, AuthorizationTokenRequest, and TokenRequest. This allows apps to work with identity providers that only permit HTTPS redirect URIs by decoupling the URL sent to the provider from the custom-scheme URL used to intercept the callback on-device.

When proxyRedirectUrl is set:

  • It is sent to the identity provider as the redirect_uri in the authorization request.
  • redirectUrl (the app's custom-scheme deep link) is still used by AppAuth to intercept the browser callback.
  • proxyRedirectUrl is also sent as redirect_uri during token exchange so it matches what was used in the authorization request, as required by OAuth 2.0.

Notes:
The proxy responsible for the final redirect must be configured accordingly, but this is out of the scope of this PR.

When proxyRedirectUrl is not set, behaviour is identical to before.

- Improved null safety in the example app's response processing logic.
- Applied minor formatting changes.
… arguments

- Added test case to verify `proxyRedirectUrl` is correctly passed in `TokenRequest` method calls
@luis901101
Copy link
Copy Markdown
Author

This PR fixes #651

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