2

是否可以使用 spring security 5.xx 为 spring boot 2.0 应用程序配置或自动连接 JWE 密钥选择器,以便能够解密从 OpenId 连接提供程序接收到的 id_oken?

JWS 密钥可以由 spring security oauth2客户端注册属性定义。但是我没有找到为spring security oauth使用的 JWTDecoder 指定JWEKeySelector的方法。

提前致谢!

依赖项:

buildscript {
    ext {
        springBootVersion = '2.0.0.RELEASE'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

ext['thymeleaf.version'] = '3.0.9.RELEASE'

dependencies {

    compile 'org.springframework.security:spring-security-config'
    compile 'org.springframework.security:spring-security-oauth2-client'
    compile 'org.springframework.security:spring-security-oauth2-jose'

    compile 'org.springframework.boot:spring-boot-starter-web'
    compile 'org.springframework.boot:spring-boot-starter-thymeleaf'
    compile 'org.thymeleaf.extras:thymeleaf-extras-springsecurity4'
    compile 'io.projectreactor.ipc:reactor-netty'
    compile 'org.springframework:spring-webflux'

    compile 'org.webjars:jquery:3.3.1-1'
    compile 'org.webjars:bootstrap:4.0.0-1'
    compile 'org.webjars:webjars-locator:0.32'

    testCompile 'org.springframework.security:spring-security-test'
    testCompile 'org.springframework.boot:spring-boot-starter-test'
}
4

0 回答 0