AppAuth-Android icon indicating copy to clipboard operation
AppAuth-Android copied to clipboard

AuthorizationException: {"type":0,"code":3,"errorDescription":"Network error"}

Open ritusuman10 opened this issue 3 years ago • 4 comments

Checklist:

  • [x] I am using the latest release
  • [x] I searched for existing GitHub issues
  • [x] I read the documentation
  • [x] I verified the client configuration matches the information in the identity provider (or I am using dynamic client registration)
  • [x] I am either using a custom URI scheme or https with App Links for client redirect.
  • [x] I can reproduce the issue in the demo app (optional)

Configuration

  • Version: 0.11.1
  • Integration: Java
  • Identity provider: Auth0

Issue Description

i am getting AuthorizationException after login while getting token from mAuthService.performTokenRequest. here is the error :

AuthorizationException: {"type":0,"code":3,"errorDescription":"Network error"}

ritusuman10 avatar Jul 25 '22 14:07 ritusuman10

Sorry, but you need to do your own debugging to figure this out. There's not enough information provide any sort of assistance.

agologan avatar Jul 27 '22 08:07 agologan

could you please help me to find out the root cause for this

ritusuman10 avatar Jul 28 '22 12:07 ritusuman10

Hi i debug my code and found out that doInBackground method inside AuthorizationService class give exception i.e java.net.SocketTimeoutException: timeout.How we can handle this.

ritusuman10 avatar Aug 01 '22 06:08 ritusuman10

Not sure what your expectation is here. As far as I can tell from this thread, you get a typical network connection error which is surfaced in your app as an AuthorizationException. It's up to you and your own app logic to determine what the app or the user needs to do in this case.

agologan avatar Sep 12 '22 18:09 agologan

My server is taking more than 10 sec for getting the response. That's why I am getting the above issue. Could you please tell me how to set the timeout in my code.

ritusuman10 avatar Oct 25 '22 14:10 ritusuman10

Need to create your own ConnectionBuilder per https://github.com/openid/AppAuth-Android#customizing-the-connection-builder-for-http-requests The default one is here: https://github.com/openid/AppAuth-Android/blob/master/library/java/net/openid/appauth/connectivity/DefaultConnectionBuilder.java

Marking this as resolved for now. Feel free to reply if you need further help.

agologan avatar Oct 27 '22 18:10 agologan