org.springframework.security.saml.userdetails.SAMLUserDetailsService Java Examples

The following examples show how to use org.springframework.security.saml.userdetails.SAMLUserDetailsService. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Auth0SSODemoApplication.java    From spring-boot-security-saml-samples with MIT License 6 votes vote down vote up
@Bean
public SAMLUserDetailsService userDetailsService() {
    return new SAMLUserDetailsService() {
        @Override
        public Object loadUserBySAML(SAMLCredential samlCredential) throws UsernameNotFoundException {
            return new SAMLUserDetails(samlCredential) {
                @Override
                public Map<String, String> getAttributes() {
                    return samlCredential.getAttributes().stream()
                            .collect(Collectors.toMap(Attribute::getName, this::getValue));
                }

                private String getValue(Attribute attribute) {
                    return Optional.ofNullable(getAttribute(attribute.getName())).orElse("");
                }
            };
        }
    };
}
 
Example #2
Source File: AuthenticationHandler.java    From blackduck-alert with Apache License 2.0 4 votes vote down vote up
@Bean
public SAMLUserDetailsService samlUserDetailsService() {
    return new UserDetailsService(authoritiesPopulator);
}
 
Example #3
Source File: InsightsSecurityConfigurationAdapterSAML.java    From Insights with Apache License 2.0 4 votes vote down vote up
/**
 * Used to provide SamlUserDetails object
 * 
 * @return
 */
@Bean
@Conditional(InsightsSAMLBeanInitializationCondition.class)
public SAMLUserDetailsService samlUserDetailsService() {
	return new SamlUserDetailsServiceImpl();
}
 
Example #4
Source File: SAMLConfigurer.java    From spring-security-saml-dsl with MIT License 4 votes vote down vote up
public SAMLConfigurer userDetailsService(SAMLUserDetailsService samlUserDetailsService) {
	this.samlUserDetailsService = samlUserDetailsService;
	return this;
}