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

Configurable local callback server #17

Open
ludoo0d0a opened this issue Sep 8, 2019 · 2 comments
Open

Configurable local callback server #17

ludoo0d0a opened this issue Sep 8, 2019 · 2 comments

Comments

@ludoo0d0a
Copy link

Hi,

API providers are sometimes very restrictive about redirect uris.
Please provide a way to customize the server parameters so that it can match every callback uri.
Especially the port number.

@acoutts
Copy link

acoutts commented Jan 29, 2020

@ludoo0d0a can you try this approach? I think this is safer too. Using a non-https localhost server could be sniffed by a malware on the device.

  1. set redirect URI as some deep link only your app would know, like:
    com.yourapp://oauthredirect
  2. open a webview to the authorization URL with the redirect set as that deep link.
  3. hook into the onNavigate method for the webview and detect if you're going to a link matching your oauth redirect.
  4. capture the token response and close the webview.

@acoutts
Copy link

acoutts commented Jan 29, 2020

Actually for oauth, I just learned the entire approach of implementing your own webview flow is a really bad idea. Use the native AppAuth library instead, which utilizes secure webviews on both iOS and Android.

Here's a convenient Flutter wrapper library for it: https://pub.dev/packages/flutter_appauth

More info here: https://www.gluu.org/blog/webviews-are-bad-use-appauth/

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

2 participants