org.springframework.security.saml.websso.WebSSOProfile Java Examples

The following examples show how to use org.springframework.security.saml.websso.WebSSOProfile. 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: WebSSOProfileConfigurer.java    From spring-boot-security-saml with MIT License 5 votes vote down vote up
@Override
public void configure(ServiceProviderBuilder builder) throws Exception {
    if (webSSOProfileBean == null) {
        if (webSSOProfile == null) {
            webSSOProfile = createDefaultWebSSOProfile();
        }
        builder.setSharedObject(WebSSOProfile.class, webSSOProfile);
    }
}
 
Example #2
Source File: WebSSOProfileConfigurerTest.java    From spring-boot-security-saml with MIT License 5 votes vote down vote up
@Test
public void configure() throws Exception {
    WebSSOProfileConfigurer configurer = spy(new WebSSOProfileConfigurer());
    WebSSOProfile profile = mock(WebSSOProfile.class);
    when(configurer.createDefaultWebSSOProfile()).thenReturn(profile);
    configurer.init(builder);
    configurer.configure(builder);
    verify(builder).setSharedObject(eq(WebSSOProfile.class), eq(profile));
}
 
Example #3
Source File: WebSSOProfileConfigurerTest.java    From spring-boot-security-saml with MIT License 5 votes vote down vote up
@Test
public void configure_forBean() throws Exception {
    WebSSOProfileConfigurer configurer = spy(new WebSSOProfileConfigurer());
    WebSSOProfile profile = mock(WebSSOProfile.class);
    when(builder.getSharedObject(WebSSOProfile.class)).thenReturn(profile);
    configurer.init(builder);
    configurer.configure(builder);
    verify(configurer, never()).createDefaultWebSSOProfile();
    verify(builder, never()).setSharedObject(any(), any());
    verifyZeroInteractions(profile);
}
 
Example #4
Source File: WebSSOProfileConfigurerTest.java    From spring-boot-security-saml with MIT License 5 votes vote down vote up
@Test
public void configure_forConstructor() throws Exception {
    WebSSOProfile profile = mock(WebSSOProfile.class);
    WebSSOProfileConfigurer configurer = spy(new WebSSOProfileConfigurer(profile));
    configurer.init(builder);
    configurer.configure(builder);
    verify(configurer, never()).createDefaultWebSSOProfile();
    verify(builder).setSharedObject(WebSSOProfile.class, profile);
    verifyZeroInteractions(profile);
}
 
Example #5
Source File: SamlConfig.java    From blackduck-alert with Apache License 2.0 4 votes vote down vote up
@Bean
public WebSSOProfile webSSOprofile() {
    return new WebSSOProfileImpl();
}
 
Example #6
Source File: InsightsSecurityConfigurationAdapterSAML.java    From Insights with Apache License 2.0 4 votes vote down vote up
/**
 * SAML 2.0 Web SSO profile
 * 
 * @return
 */
@Bean
@Conditional(InsightsSAMLBeanInitializationCondition.class)
public WebSSOProfile webSSOprofile() {
	return new WebSSOProfileImpl();
}
 
Example #7
Source File: WebSSOProfileConfigurer.java    From spring-boot-security-saml with MIT License 4 votes vote down vote up
public WebSSOProfileConfigurer(WebSSOProfile webSSOProfile) {
    this.webSSOProfile = webSSOProfile;
}
 
Example #8
Source File: WebSSOProfileConfigurer.java    From spring-boot-security-saml with MIT License 4 votes vote down vote up
@Override
public void init(ServiceProviderBuilder builder) throws Exception {
    webSSOProfileBean = builder.getSharedObject(WebSSOProfile.class);
}
 
Example #9
Source File: WebSSOProfileConfigurer.java    From spring-boot-security-saml with MIT License 4 votes vote down vote up
@VisibleForTesting
protected WebSSOProfile createDefaultWebSSOProfile() {
    return new WebSSOProfileImpl();
}
 
Example #10
Source File: WebSSOProfileConfigurerTest.java    From spring-boot-security-saml with MIT License 4 votes vote down vote up
@Test
public void init() throws Exception {
    WebSSOProfileConfigurer configurer = new WebSSOProfileConfigurer();
    configurer.init(builder);
    verify(builder).getSharedObject(eq(WebSSOProfile.class));
}
 
Example #11
Source File: WebSecurityConfig.java    From spring-boot-security-saml-sample with Apache License 2.0 4 votes vote down vote up
@Bean
public WebSSOProfile webSSOprofile() {
    return new WebSSOProfileImpl();
}
 
Example #12
Source File: SAMLDslEntryPoint.java    From spring-security-saml-dsl with MIT License 3 votes vote down vote up
/**
 * Profile for consumption of processed messages, cannot be null, must be set.
 * It is set in the custom config, so can be optional here.
 * User could override it if desired.
 *
 * @param webSSOprofile profile
 */
@Autowired(required = false)
@Qualifier("webSSOprofile")
@Override
public void setWebSSOprofile(WebSSOProfile webSSOprofile) {
	super.setWebSSOprofile(webSSOprofile);
}