I am using AppAuth library for Oauth2 authentication. https://github.com/openid/AppAuth-Android
I am using google's app auth example. https://codelabs.developers.google.com/codelabs/appauth-android-codelab/#0
I modified the urls as per my oauth provider. I have specified a valid authorization endpoint, client id, redirect uri, token uri, scope(openid, profile, email), response type (Code). I don't know if there is a way to add consumer secret. I have not seen anywhere in the sample code a way to add consumer secret. When I run the app, I see our sso page, I am able to login, redirect happens. When the request to get token gets executed, I get an exception. The token request is failing. Any idea why this would happen? The token exchange url is correct and I am not sure why it is complaining about file not being found at that particular token url. Any pointers on digging more into this issue?
W/AppAuthSample: Token Exchange failed
AuthorizationException: {"type":0,"code":3,"errorDescription":"Network error"}
at net.openid.appauth.AuthorizationService$TokenRequestTask.doInBackground(AuthorizationService.java:244)
at net.openid.appauth.AuthorizationService$TokenRequestTask.doInBackground(AuthorizationService.java:206)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.io.FileNotFoundException: <token_url>
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:251)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:26)
at net.openid.appauth.AuthorizationService$TokenRequestTask.doInBackground(AuthorizationService.java:239)
at net.openid.appauth.AuthorizationService$TokenRequestTask.doInBackground(AuthorizationService.java:206)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)