flutter_appauth icon indicating copy to clipboard operation
flutter_appauth copied to clipboard

Multi tenant in iOS

Open LeonardoMel0 opened this issue 1 year ago • 2 comments

i can use this url to authenticate in Android but in iOS i have this issue:

PlatformException(discovery_failed, Error retrieving discovery document: JSON error parsing document at 'https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration': Invalid URL: issuer, null, null)

my code:

result = await appauth.authorizeAndExchangeCode( AuthorizationTokenRequest( _clientId, _redirectURL, discoveryUrl: 'https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration', scopes: _scopes, ), );

LeonardoMel0 avatar Dec 22 '23 18:12 LeonardoMel0

Not able to help much more with this one as it would be the AppAuth iOS SDK that this plugin uses that would be reporting this error. You should be able to specify the endpoints explicitly rather than using the discovery document instead as another solution

MaikuB avatar Jan 20 '24 01:01 MaikuB

Issuer mismatch authorize_and_exchange_code_failed Failed to authorize: [error: null, description: Invalid ID Token]

You should be able to specify the endpoints explicitly

for people struggling in the future I replaced discoveryUrl with :

    serviceConfiguration: const AuthorizationServiceConfiguration(
      authorizationEndpoint: 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize',
      tokenEndpoint: 'https://login.microsoftonline.com/common/oauth2/v2.0/token',
    );

it works ! 🙂 🎉

AristideVB avatar Apr 08 '24 12:04 AristideVB