Getting discovery_failed?
Hi, any idea what this means? It happens on android 10, but not always. PlatformException(discovery_failed, Error retrieving discovery document: [error: null, description: Network error], null, null).
The code:
` Future<TokenResponse> reLoginAction(String storedRefreshToken) async {
return await synchronized(() async {
try {
final TokenResponse? result = await _appAuth.token(TokenRequest(
this.clientId,
REDIRECT_URI,
issuer:
'https://${this.domain}/oauth2/***********', //real string
discoveryUrl: OKTA_DISCOVERY_URL,
refreshToken: storedRefreshToken,
));
return result!;
} on Exception catch (e, s) {
logger.e('error on login', e, s);
}
throw Exception("ReSign in issue");
});
}`
If you look at the description of the error it says "Network error" so implies there's an issue getting the discovery document, possibly due to network connectivity issues or other reasons. This is outside of the control of the plugin
Ok, currently investigating this issue with Okta. Thanks.
Have you checked to make sure it's not a connection issue on your end? I've tried this with Okta in the past for testing purposes and didn't run into issues. I recall hearing off others using this plugin with Okta too and didn't see reports of issues like this
Well, the strange thing is that 98% of the times, this code works. 2% of the time it fails (and then I have a fall back that opens the browser just fine for the login).
I'm having the same issue. It had been working correctly until the past week. Now, I noticed these problems in Android. I'm sure it doesn't have anything related to connection problems.
Who is the issuer?
I'm also getting the same error. The full error is
PlatformException (PlatformException(discovery_failed, Error retrieving discovery document: [error: null, description: Network error], null, null))
This error is outside of the plugin's control. It would be when the native SDKs detect a network error as it fails to hit the discovery endpoint due to either a connection issue or wrong information being provided. You could try to explicitly specify the endpoints but if it's connection issue then chances are it won't help