我正在使用Spring Security SAML实现SP,该SP重定向到IDP进行身份验证。我将从IDP中获取断言中的用户详细信息。我不确定如何从我收到的响应中捕获那些用户属性
我可以登录,并且可以使用chrome工具查看SAML响应。
这是我实现spring saml的代码
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Value("${security.saml2.metadata-url}")
String metadataUrl;
@Value("${server.ssl.entity-id}")
String entityId;
@Value("${server.ssl.key-alias}")
String keyAlias;
@Value("${server.ssl.key-store-password}")
String password;
@Value("${server.port}")
String port;
@Value("${server.ssl.key-store}")
Resource keyStore;
@Value("${server.ssl.key-store}")
String keyStoreAlias;
@Value("${server.ssl.postLogoutURL}")
String postLogoutURL;
@Value("${server.ssl.appId}")
String appId;
@Value("${server.ssl.key-alias}")
String alias;
@Override
protected void configure(final HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/saml*").permitAll()
.anyRequest().authenticated()
.and()
.apply(saml())
.serviceProvider()
.keyStore()
.storeFilePath(this.keyStoreAlias)
.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);
}
因此,如何在此处获取春季saml中的SAML响应。
谢谢