【问题标题】:Spring boot starter security - missing RsaKeyConvertersSpring Boot 启动器安全性 - 缺少 RsaKeyConverters
【发布时间】:2020-06-11 19:03:06
【问题描述】:

我正在尝试将 spring-boot-startet-security 与 JWT 和 OAuth 一起使用。

我用这个tutorial 来获得一个可以使用的基础。有一个错误:java.lang.NoClassDefFoundError: org/springframework/security/converter/RsaKeyConverters" Exception 在我的应用程序启动过程的开头。

我想我缺少一个依赖项。我已经尝试过spring-security-configspring-security-core,但是没有用。

我需要自己提供RsaKeyConverters 类吗?

感谢您的帮助!

POM

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
    <version>2.1.2.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
    <version>2.1.2.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <version>2.1.2.RELEASE</version>
    <optional>true</optional>
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot</artifactId>
    <version>2.1.2.RELEASE</version>
</dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>5.4.2.Final</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
        <version>2.1.4.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>8.0.15</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
        <version>2.2.2.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>com.auth0</groupId>
        <artifactId>java-jwt</artifactId>
        <version>3.8.1</version>
    </dependency>
    <dependency>
        <groupId>com.auth0</groupId>
        <artifactId>auth0-spring-security-api</artifactId>
        <version>1.2.6</version>
    </dependency>

【问题讨论】:

    标签: java spring spring-boot spring-security jwt-auth


    【解决方案1】:

    我自己也遇到了这个问题,这是为我整理的。

    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-core</artifactId>
      <version>5.3.2.RELEASE</version>
    </dependency>
    

    【讨论】:

      猜你喜欢
      • 2014-10-29
      • 2020-08-25
      • 2020-02-09
      • 2016-06-27
      • 2020-01-03
      • 1970-01-01
      • 1970-01-01
      • 2016-10-15
      • 2022-01-22
      相关资源
      最近更新 更多