Istio authservice oidc无法为访问令牌交换授权代码

问题描述 投票:1回答:1

我们正在尝试在我们的k8s集群中使用istio为authZ和authN设置oidc提供程序。我们在此遵循以下示例:Bookinfo with Authservice Example用于集成。以下是有关设置的详细信息:

OIDC提供者:Keycloak授予类型:authorization_codeIstio版本:1.5

认证流程:

  1. 在第一次请求时,由于没有身份验证,authservice成功重定向到Keycloak,我们可以在此成功登录。
  2. 然后,Keycloak将请求重定向到redirect_uri上的应用程序。授权码现在在此uri中存在。
  3. redirect_uri再次被authservice拦截,它检测到该URL是the configmap中定义的oidc的过滤器URL。>
  4. 现在,它尝试调用密钥斗篷来交换访问令牌的授权代码。
  5. 这是authservice失败并给出错误IdP connection error的步骤。该请求的日志如下:

Check: processing request ://microservice.url.com/appservice/oauth/callback?state=LeCNEqfwA6EUFGNGLt7JALx8jCWkPxjn7qCELbqkKrk&session_state=18f0e3b0-bee2-44a5-b049-6e349dbeda49&code=ddea1ea6-5616-416d-8291-c00bce6f2e9b.18f0e3b0-bee2-44a5-b049-6e349dbeda49.af7e7c31-fd4b-4a66-9856-25d1ac305d3f with filter chain idp_filter_chain
20/03/2020 17:27:48 [2020-03-20 11:57:48.546] [console] [trace] New
20/03/2020 17:27:48 [2020-03-20 11:57:48.547] [console] [trace] OidcFilter
20/03/2020 17:27:48 [2020-03-20 11:57:48.548] [console] [trace] Process
20/03/2020 17:27:48 [2020-03-20 11:57:48.548] [console] [debug] Call from @10.42.5.53 to @10.42.5.58
20/03/2020 17:27:48 [2020-03-20 11:57:48.549] [console] [trace] MatchesCallbackRequest: checking handler for ://microservice.url.com/appservice/oauth/callback?state=LeCNEqfwA6EUFGNGLt7JALx8jCWkPxjn7qCELbqkKrk&session_state=18f0e3b0-bee2-44a5-b049-6e349dbeda49&code=ddea1ea6-5616-416d-8291-c00bce6f2e9b.18f0e3b0-bee2-44a5-b049-6e349dbeda49.af7e7c31-fd4b-4a66-9856-25d1ac305d3f
20/03/2020 17:27:48 [2020-03-20 11:57:48.549] [console] [trace] RetrieveToken
20/03/2020 17:27:48 [2020-03-20 11:57:48.550] [console] [trace] Post
20/03/2020 17:27:48 [2020-03-20 11:57:48.618] [console] [info] Post: HTTP error encountered: stream truncated
20/03/2020 17:27:48 [2020-03-20 11:57:48.618] [console] [info] RetrieveToken: HTTP error encountered: IdP connection error
20/03/2020 17:27:48 [2020-03-20 11:57:48.618] [console] [trace] Request processing complete
20/03/2020 17:27:48 [2020-03-20 11:57:48.619] [console] [trace] Processing completion and deleting state

在进一步检查代码时,我发现此错误是从这里触发的:Authservice oidc filter - Github

为了排除配置问题,我使用OpenID Debugger手动生成授权码,然后调用api将其交换为api令牌。我能够成功检索它,没有问题。但是以某种方式,使用authservice失败。

我到底有什么问题吗?有人遇到过这个问题吗?任何帮助表示赞赏。让我知道是否需要更多详细信息。

我们正在尝试在我们的k8s集群中使用istio为authZ和authN设置oidc提供程序。我们在此遵循以下示例:集成Authservice的Bookinfo示例。下面是详细信息...

authentication openid openid-connect keycloak istio
1个回答
0
投票

此问题已由authservice团队修复。正如authservice的Ryan所说,这里的问题是:

日志表明请求一直成功到结束,直到Authservice尝试正常关闭TLS连接,而另一端的服务器没有完全参与正常关闭。

© www.soinside.com 2019 - 2024. All rights reserved.