我收到以下警告。如何设置entityBaseURL?
2018-04-19 19:38:00.771 WARN 31852 --- [http-nio-8080-exec-1] o.s.s.s.m.MetadataGeneratorFilter : Generated default entity base URL https://test-auth.onlinephotosubmission.com:443 based on values in the first server request. Please set property entityBaseURL on MetadataGenerator bean bean to fixate the value.
答案 0 :(得分:0)
在application.properties
中,添加以下设置
saml.sso.metadata-generator.entity-base-url=https://myserver.mydomain.com
在您的配置文件中(我的名字叫WebSecurityConfig
),添加以下字段
@Value("${saml.sso.metadata-generator.entity-base-url}")
private String entityBaseUrl;
然后在同一配置文件中,通过调用entityBaseUrl
在MetadataGenerator
bean上设置setEntityBaseURL()
。
@Bean
public MetadataGenerator metadataGenerator() {
MetadataGenerator metadataGenerator = new MetadataGenerator();
metadataGenerator.setEntityId(samlSpId);
metadataGenerator.setExtendedMetadata(extendedMetadata());
metadataGenerator.setIncludeDiscoveryExtension(false);
metadataGenerator.setKeyManager(keyManager());
metadataGenerator.setEntityBaseURL(entityBaseUrl);
return metadataGenerator;
}