Examples of AuthenticationSource


Examples of de.innovationgate.wga.config.AuthenticationSource

        protected void init() {
          if (_config != null) {
              // Authentication
              try {
                  AuthModuleFactory authFactory = WGFactory.getAuthModuleFactory();
                  AuthenticationSource authSource = _config.getAuthenticationSource();
                  if (authSource != null) {
                    _authModule = authFactory.getAuthModule(authSource.getImplClassName(), authSource.getOptions(), null);
                  }
              }
              catch (de.innovationgate.webgate.api.auth.ConfigurationException e) {
                  getLog().error("Authentication module of domain '" + getName() + "' is misconfigured and inactive", e);
              }
View Full Code Here

Examples of org.springframework.ldap.core.AuthenticationSource

        SecurityContextHolder.clearContext();
    }

    @Test
    public void principalAndCredentialsAreEmptyWithNoAuthentication() {
        AuthenticationSource source = new SpringSecurityAuthenticationSource();
        assertEquals("", source.getPrincipal());
        assertEquals("", source.getCredentials());
    }
View Full Code Here

Examples of org.springframework.ldap.core.AuthenticationSource

        assertEquals("", source.getCredentials());
    }

    @Test
    public void principalIsEmptyForAnonymousUser() {
        AuthenticationSource source = new SpringSecurityAuthenticationSource();

        SecurityContextHolder.getContext().setAuthentication(
                new AnonymousAuthenticationToken("key", "anonUser", AuthorityUtils.createAuthorityList("ignored")));
        assertEquals("", source.getPrincipal());
    }
View Full Code Here

Examples of org.springframework.ldap.core.AuthenticationSource

        assertEquals("", source.getPrincipal());
    }

    @Test(expected=IllegalArgumentException.class)
    public void getPrincipalRejectsNonLdapUserDetailsObject() {
        AuthenticationSource source = new SpringSecurityAuthenticationSource();
        SecurityContextHolder.getContext().setAuthentication(new TestingAuthenticationToken(new Object(), "password"));

        source.getPrincipal();
    }
View Full Code Here

Examples of org.springframework.ldap.core.AuthenticationSource

        source.getPrincipal();
    }

    @Test
    public void expectedCredentialsAreReturned() {
        AuthenticationSource source = new SpringSecurityAuthenticationSource();
        SecurityContextHolder.getContext().setAuthentication(new TestingAuthenticationToken(new Object(), "password"));

        assertEquals("password", source.getCredentials());
    }
View Full Code Here

Examples of org.springframework.ldap.core.AuthenticationSource

    @Test
    public void expectedPrincipalIsReturned() {
        LdapUserDetailsImpl.Essence user = new LdapUserDetailsImpl.Essence();
        user.setUsername("joe");
        user.setDn(new DistinguishedName("uid=joe,ou=users"));
        AuthenticationSource source = new SpringSecurityAuthenticationSource();
        SecurityContextHolder.getContext().setAuthentication(
                new TestingAuthenticationToken(user.createUserDetails(), null));

        assertEquals("uid=joe,ou=users", source.getPrincipal());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.