MaikuB / flutter_appauth

A Flutter wrapper for AppAuth iOS and Android SDKs
270 stars 243 forks source link

Different redirect URL to send and to receive #311

Closed qujeee closed 2 years ago

qujeee commented 2 years ago

I’m trying to connect a service to my flutter app and have followed this guide (I'm not using the services of Auth0) on adding auth to a Flutter app using flutter_appauth.

My problem is that when I use AuthorizationTokenRequest the redirectUrl I send is different from what is send back by the service. The redirectUrl send: urlScheme://oauth/callback The redirectUrl that opens my app after logging in: urlScheme://oauth:443/callback

Because this service is not mine I can’t change it and when I intercept the url that’s redirecting to the app, delete the :443 and paste it in the browser the loggin works perfect. So my question is: is there a way to choose a redirectUrl to send and a different redirectUrl for the callback to listen to?

final AuthorizationTokenResponse? result =
          await appAuth.authorizeAndExchangeCode(
        AuthorizationTokenRequest(
          CLIENT_ID,
          REDIRECT_URI,
          issuer: 'https://$DOMAIN',
          scopes: ['openid'],
          promptValues: ['login'],
        ),
      );
MaikuB commented 2 years ago

No, even if there was, it's not a matter for the plugin as redirect URLs need to be registered with your IdP/service and the issue here is to do with your service. Will close this issue in light of this

qujeee commented 2 years ago

Thanks for your answer. I understand that this isn't a common problem. So I have solved it by editing the iOS and Android App Auth library locally to delete the 443 port.