【问题标题】:Is there a way to prevent MPJwt authenticating unprotected / permitted endpoints. Using Openliberty server有没有办法防止 Jwt 身份验证不受保护/允许的端点。使用 Open Liberty 服务器
【发布时间】:2021-08-30 12:18:40
【问题描述】:
  1. open liberty server.xml 的 Mpjwt 配置

    <mpJwt
       id="keycloakJwt"
       jwksUri="https://auth.ura.go.ug/auth/realms/sso/protocol/openid- connect/certs"
       issuer="https://auth.ura.go.ug/auth/realms/sso"
       userNameAttribute="preferred_username"
       audiences="askura-etax-ws">
    </mpJwt>
    
  2. 未受保护的路由在访问 CWWKS5522E 时返回以下错误:MicroProfile JWT 功能无法执行身份验证,因为在请求中找不到 MicroProfile JWT。

    @PermitAll
    @Path("/test")
    public class TestResource {
      @Inject
      AppProperty appProperty;
    
      @GET
      @Path("/ping")
      @Produces(MediaType.TEXT_PLAIN)
      public String test() {
         return "TEST";
      }
    }
    

【问题讨论】:

    标签: open-liberty microprofile


    【解决方案1】:

    CWWKS5522E 消息周围的代码最近在 21.0.0.2 中的 https://github.com/OpenLiberty/open-liberty/pull/15606 中更新,当资源不受保护时不会发出。请确认您使用的是至少该版本还是更新版本。如果是,请在https://github.com/OpenLiberty/open-liberty/issues 中提出问题,我们可以帮助您调试问题。

    问候,

    泰迪

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-11-05
      • 2019-08-22
      • 2019-11-22
      • 2010-11-20
      • 1970-01-01
      • 2017-05-13
      • 2017-06-30
      • 1970-01-01
      相关资源
      最近更新 更多