问题
While integrating Keyclock SDK , I try to exchange authorization code to access token
authService.performTokenRequest(
resp.createTokenExchangeRequest(),
new AuthorizationService.TokenResponseCallback() {
@Override public void onTokenRequestCompleted(
TokenResponse resp, AuthorizationException ex) {
if (resp != null) {
// exchange succeeded
} else {
// authorization failed, check ex for more details
}
}
});
I got the following error,
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:354)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
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.lang.IllegalArgumentException: only https connections are permitted
at net.openid.appauth.Preconditions.checkArgument(Preconditions.java:116)
at net.openid.appauth.connectivity.DefaultConnectionBuilder.openConnection(DefaultConnectionBuilder.java:51)
at net.openid.appauth.AuthorizationService$TokenRequestTask.doInBackground(AuthorizationService.java:418)
at net.openid.appauth.AuthorizationService$TokenRequestTask.doInBackground(AuthorizationService.java:395)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
回答1:
The log is almost clear
only https connections are permitted
I think your answer is here:
Android 8: Cleartext HTTP traffic not permitted
update:
after I look at the Github repository I find this error in issues
Error: only https connections are permitted
来源:https://stackoverflow.com/questions/65664553/an-error-occurred-while-executing-doinbackground-for-keyclock-authservice-perf