В последнем проекте я использовал
Код: Выделить всё
org.springframework.boot
spring-boot-starter-parent
2.1.2.RELEASE
Код: Выделить всё
org.springframework.security.extensions
spring-security-saml2-core
1.0.10.RELEASE
org.springframework.security.extensions
spring-security-saml-dsl-core
1.0.5.RELEASE
И в файле метаданных, созданном передающей стороной, я мог видеть:
Код: Выделить всё
Код: Выделить всё
3.4.0-M3
2.0.0.M31
1.0.5.RELEASE
6.4.0-M4
Это моя конфигурация безопасности
Код: Выделить всё
@Configuration
@EnableWebSecurity
@EnableMethodSecurity(securedEnabled = true)
public class SecurityConfig{
private static final String SAML_METADATA = "/saml/metadata";
@Autowired
PmaLdapValidationHandler pmaLdapValidationHandler;
@Bean
SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
// @formatter:off
http
.saml2Metadata((saml2) -> saml2.metadataUrl(SAML_METADATA))
.saml2Login(withDefaults()).saml2Logout(withDefaults())
.logout(withDefaults())
.authorizeHttpRequests((authorize) -> authorize.anyRequest().authenticated());
// @formatter:on
return http.build();
}
}
Код: Выделить всё
logging.level.org.springframework.security: DEBUG
logging.level.org.springframework.security.saml2: DEBUG
spring:
mvc:
view:
prefix: /templates/
suffix: .pug
static-path-pattern: /static/**
security:
saml2:
relyingparty:
registration:
pma_web:
entity-id: "${sso.entity-id}"
signing:
credentials:
- private-key-location: classpath:saml/credentials/rp-private.key
certificate-location: classpath:saml/credentials/rp-certificate.crt
singlelogout:
binding: POST
url: "{baseUrl}/logout/saml2/slo"
assertingparty:
metadata-uri: classpath:saml/${env}/metadata.xml
datasource:
jndi-name: java:jboss/datasources/pma_web
jpa:
hibernate:
ddl-auto: update
properties:
hibernate:
dialect: org.hibernate.dialect.PostgreSQLDialect
pma-cmdb:
pma-keystore-key-alias: pma-jwt-signing-key
pma-keystore-password: pma-jwt-p422w0rd
Код: Выделить всё
Как я мог это сделать?
Подробнее здесь: https://stackoverflow.com/questions/792 ... ng-securit