简体   繁体   中英

Spring Boot SAML 2.0 support

I'm implementing sample application which is supposed to combine SAML 2.0, Oauth 2.0 and UMA 2.0. I've generated Spring Boot template using initializr .

I'm stuck at the beginning by saml2ogin() . It looks like SAML 2.0 support is missed. RelyingPartyRegistrationRepository is not available. When I browse imports in HttpSecurity class, I have org.springframework.security.saml2 – Cannot resolve symbol “saml2”. According to the documentation: https://docs.spring.io/spring-security/site/docs/5.3.x/reference/html5/ SAML 2.0 support should by bundled in spring-boot-starter-security

Have I missed something?

My build.gradle:

plugins {
    id 'org.springframework.boot' version '2.2.6.RELEASE'
    id 'io.spring.dependency-management' version '1.0.9.RELEASE'
    id 'java'
}

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-security'
    implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    testImplementation('org.springframework.boot:spring-boot-starter-test') {
        exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
    }
    testImplementation 'org.springframework.security:spring-security-test'
}

test {
    useJUnitPlatform()
}
implementation 'org.springframework.security:spring-security-saml2-service-provider'

As far as I can tell that dependency is marked as optional, so it has to be included explicitly.

https://github.com/spring-projects/spring-security/blob/master/config/spring-security-config.gradle

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM