Package org.springframework.security.web.authentication.preauth.x509

Examples of org.springframework.security.web.authentication.preauth.x509.X509PrincipalExtractor


            AuthenticationManager authenticationManager) {
        if (x509AuthenticationFilter == null) {
            x509AuthenticationFilter = new X509AuthenticationFilter();
            x509AuthenticationFilter.setAuthenticationManager(authenticationManager);
            if(subjectPrincipalRegex != null) {
                SubjectDnX509PrincipalExtractor principalExtractor = new SubjectDnX509PrincipalExtractor();
                principalExtractor.setSubjectDnRegex(subjectPrincipalRegex);
                x509AuthenticationFilter.setPrincipalExtractor(principalExtractor);
            }
            if(authenticationDetailsSource != null) {
                x509AuthenticationFilter.setAuthenticationDetailsSource(authenticationDetailsSource);
            }
View Full Code Here


public class SubjectDnX509PrincipalExtractorTests {
    SubjectDnX509PrincipalExtractor extractor;

    @Before
    public void setUp() {
        extractor = new SubjectDnX509PrincipalExtractor();
        extractor.setMessageSource(new SpringSecurityMessageSource());
    }
View Full Code Here

            AuthenticationManager authenticationManager) {
        if (x509AuthenticationFilter == null) {
            x509AuthenticationFilter = new X509AuthenticationFilter();
            x509AuthenticationFilter.setAuthenticationManager(authenticationManager);
            if(subjectPrincipalRegex != null) {
                SubjectDnX509PrincipalExtractor principalExtractor = new SubjectDnX509PrincipalExtractor();
                principalExtractor.setSubjectDnRegex(subjectPrincipalRegex);
                x509AuthenticationFilter.setPrincipalExtractor(principalExtractor);
            }
            if(authenticationDetailsSource != null) {
                x509AuthenticationFilter.setAuthenticationDetailsSource(authenticationDetailsSource);
            }
View Full Code Here

        super.initializeFromConfig(config);

//      not needed at the moment       
//        X509CertificateAuthenticationFilterConfig authConfig =
//                (X509CertificateAuthenticationFilterConfig) config;
        setPrincipalExtractor(new SubjectDnX509PrincipalExtractor());
       
    }
View Full Code Here

                                            
            privateKS.store( new FileOutputStream(keyStoreFile), password.toCharArray())
      }
 
      private static boolean keyStoreContainsCertificate(KeyStore ks, String hostname) throws Exception{
          SubjectDnX509PrincipalExtractor ex = new SubjectDnX509PrincipalExtractor();
          Enumeration<String> e = ks.aliases();
          while (e.hasMoreElements()) {
              String alias = e.nextElement();
              if (ks.isCertificateEntry(alias)) {
                  Certificate c =  ks.getCertificate(alias);
View Full Code Here

            .setSharedObject(AuthenticationEntryPoint.class,new Http403ForbiddenEntryPoint());
    }

    @Override
    public void configure(H http) throws Exception {
        X509AuthenticationFilter filter = getFilter(http.getSharedObject(AuthenticationManager.class));
        http.addFilter(filter);
    }
View Full Code Here

    }

    private X509AuthenticationFilter getFilter(
            AuthenticationManager authenticationManager) {
        if (x509AuthenticationFilter == null) {
            x509AuthenticationFilter = new X509AuthenticationFilter();
            x509AuthenticationFilter.setAuthenticationManager(authenticationManager);
            if(subjectPrincipalRegex != null) {
                SubjectDnX509PrincipalExtractor principalExtractor = new SubjectDnX509PrincipalExtractor();
                principalExtractor.setSubjectDnRegex(subjectPrincipalRegex);
                x509AuthenticationFilter.setPrincipalExtractor(principalExtractor);
View Full Code Here

            .setSharedObject(AuthenticationEntryPoint.class,new Http403ForbiddenEntryPoint());
    }

    @Override
    public void configure(H http) throws Exception {
        X509AuthenticationFilter filter = getFilter(http.getAuthenticationManager());
        http.addFilter(filter);
    }
View Full Code Here

    }

    private X509AuthenticationFilter getFilter(
            AuthenticationManager authenticationManager) {
        if (x509AuthenticationFilter == null) {
            x509AuthenticationFilter = new X509AuthenticationFilter();
            x509AuthenticationFilter.setAuthenticationManager(authenticationManager);
            if(subjectPrincipalRegex != null) {
                SubjectDnX509PrincipalExtractor principalExtractor = new SubjectDnX509PrincipalExtractor();
                principalExtractor.setSubjectDnRegex(subjectPrincipalRegex);
                x509AuthenticationFilter.setPrincipalExtractor(principalExtractor);
View Full Code Here

TOP

Related Classes of org.springframework.security.web.authentication.preauth.x509.X509PrincipalExtractor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.