对关键时钟authService.performTokenRequest()函数执行doInBackground()时发生错误 [英] An error occurred while executing doInBackground() for keyclock authService.performTokenRequest() function

查看:98
本文介绍了对关键时钟authService.performTokenRequest()函数执行doInBackground()时发生错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在集成 Keyclock SDK 时, 我尝试交换授权码以访问令牌

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
      }
    }
});

我遇到以下错误,

  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)

推荐答案

日志几乎清晰

only https connections are permitted

我想你的答案在这里:

Android 8:不允许使用明文HTTP流量

更新:

查看Github存储库后,我发现了这个错误

after I look at the Github repository I find this error in issues

错误:仅允许https连接

这篇关于对关键时钟authService.performTokenRequest()函数执行doInBackground()时发生错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆