Я новичок в Spring-boot и только что получил проверку подлинности SAML с Spring Security и Okta, работающими в соответствии с этим руководством.Я не могу установить ForceAuthN в WebSSOProfileOptions при настройке с помощью WebSecurityConfigurerAdapter.
Может ли кто-нибудь дать мне пример или указать правильное направление?
Я пытаюсь использовать приведенный ниже код, но получаю ошибку типа, пожалуйстапомогите как решить
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(final HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/saml*").permitAll()
.anyRequest().authenticated()
.and()
.apply(saml())
.serviceProvider()
.keyStore()
.storeFilePath("saml/keystore.jks")
.password(this.password)
.keyname(this.keyAlias)
.keyPassword(this.password)
.and()
.protocol("https")
.hostname(String.format("%s:%s", "localhost", this.port))
.basePath("/")
.and()
.identityProvider()
.metadataFilePath(this.metadataUrl)
.and()
.WebSSOProfileOptions(getWebSSOProfileOptions());
}
@Bean
public WebSSOProfileOptions getWebSSOProfileOptions() {
WebSSOProfileOptions profile = new WebSSOProfileOptions();
profile.setForceAuthN(true);
return profile;
}
}