flutter_appauth
flutter_appauth copied to clipboard
Multi tenant in iOS
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, ), );
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
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 ! 🙂 🎉