org.springframework.security.config.annotation.web.HttpSecurityBuilder Java Examples

The following examples show how to use org.springframework.security.config.annotation.web.HttpSecurityBuilder. 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: WebAuthnConfigurerUtil.java    From webauthn4j-spring-security with Apache License 2.0 5 votes vote down vote up
static <H extends HttpSecurityBuilder<H>> ChallengeRepository getChallengeRepository(H http) {
    ApplicationContext applicationContext = http.getSharedObject(ApplicationContext.class);
    ChallengeRepository challengeRepository;
    String[] beanNames = applicationContext.getBeanNamesForType(ChallengeRepository.class);
    if (beanNames.length == 0) {
        challengeRepository = new HttpSessionChallengeRepository();
    } else {
        challengeRepository = applicationContext.getBean(ChallengeRepository.class);
    }
    return challengeRepository;
}
 
Example #2
Source File: WebAuthnConfigurerUtil.java    From webauthn4j-spring-security with Apache License 2.0 5 votes vote down vote up
public static <H extends HttpSecurityBuilder<H>> OptionsProvider getOptionsProvider(H http) {
    ApplicationContext applicationContext = http.getSharedObject(ApplicationContext.class);
    OptionsProvider optionsProvider;
    String[] beanNames = applicationContext.getBeanNamesForType(OptionsProvider.class);
    if (beanNames.length == 0) {
        WebAuthnUserDetailsService userDetailsService = applicationContext.getBean(WebAuthnUserDetailsService.class);
        optionsProvider = new OptionsProviderImpl(userDetailsService, getChallengeRepository(http));
    } else {
        optionsProvider = applicationContext.getBean(OptionsProvider.class);
    }
    return optionsProvider;
}
 
Example #3
Source File: WebAuthnConfigurerUtil.java    From webauthn4j-spring-security with Apache License 2.0 5 votes vote down vote up
public static <H extends HttpSecurityBuilder<H>> ServerPropertyProvider getServerPropertyProvider(H http) {
    ApplicationContext applicationContext = http.getSharedObject(ApplicationContext.class);
    ServerPropertyProvider serverPropertyProvider;
    String[] beanNames = applicationContext.getBeanNamesForType(ServerPropertyProvider.class);
    if (beanNames.length == 0) {
        serverPropertyProvider = new ServerPropertyProviderImpl(getOptionsProvider(http), getChallengeRepository(http));
    } else {
        serverPropertyProvider = applicationContext.getBean(ServerPropertyProvider.class);
    }
    return serverPropertyProvider;
}
 
Example #4
Source File: WebAuthnConfigurerUtil.java    From webauthn4j-spring-security with Apache License 2.0 4 votes vote down vote up
public static <H extends HttpSecurityBuilder<H>> WebAuthnUserDetailsService getWebAuthnUserDetailsService(H http) {
    ApplicationContext applicationContext = http.getSharedObject(ApplicationContext.class);
    return applicationContext.getBean(WebAuthnUserDetailsService.class);
}
 
Example #5
Source File: WebAuthnConfigurerUtil.java    From webauthn4j-spring-security with Apache License 2.0 4 votes vote down vote up
public static <H extends HttpSecurityBuilder<H>> WebAuthnRegistrationRequestValidator getWebAuthnRegistrationRequestValidator(H http) {
    ApplicationContext applicationContext = http.getSharedObject(ApplicationContext.class);
    return applicationContext.getBean(WebAuthnRegistrationRequestValidator.class);
}