Examples of authenticate()


Examples of org.springframework.security.authentication.RememberMeAuthenticationProvider.authenticate()

        RememberMeAuthenticationToken token = new RememberMeAuthenticationToken("WRONG_KEY", "Test",
                AuthorityUtils.createAuthorityList("ROLE_ONE", "ROLE_TWO"));

        try {
            aap.authenticate(token);
            fail("Should have thrown BadCredentialsException");
        } catch (BadCredentialsException expected) {
        }
    }
View Full Code Here

Examples of org.springframework.security.authentication.TestingAuthenticationProvider.authenticate()

public class TestingAuthenticationProviderTests extends TestCase {

    public void testAuthenticates() {
        TestingAuthenticationProvider provider = new TestingAuthenticationProvider();
        TestingAuthenticationToken token = new TestingAuthenticationToken("Test", "Password","ROLE_ONE","ROLE_TWO");
        Authentication result = provider.authenticate(token);

        assertTrue(result instanceof TestingAuthenticationToken);

        TestingAuthenticationToken castResult = (TestingAuthenticationToken) result;
        assertEquals("Test", castResult.getPrincipal());
View Full Code Here

Examples of org.springframework.security.authentication.dao.DaoAuthenticationProvider.authenticate()

                "  </authentication-provider>" +
                "</authentication-manager>" + DATA_SOURCE + USER_CACHE_XML);
        ProviderManager mgr = (ProviderManager) appContext.getBean(BeanIds.AUTHENTICATION_MANAGER);
        DaoAuthenticationProvider provider = (DaoAuthenticationProvider) mgr.getProviders().get(0);
        assertSame(provider.getUserCache(), appContext.getBean("userCache"));
        provider.authenticate(new UsernamePasswordAuthenticationToken("rod","koala"));
        assertNotNull("Cache should contain user after authentication", provider.getUserCache().getUserFromCache("rod"));
    }

    @Test
    public void rolePrefixIsUsedWhenSet() {
View Full Code Here

Examples of org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationProvider.authenticate()

    @Test
    public final void authenticateInvalidToken() throws Exception {
        UserDetails ud = new User("dummyUser", "dummyPwd", true, true, true, true, AuthorityUtils.NO_AUTHORITIES );
        PreAuthenticatedAuthenticationProvider provider = getProvider(ud);
        Authentication request = new UsernamePasswordAuthenticationToken("dummyUser", "dummyPwd");
        Authentication result = provider.authenticate(request);
        assertNull(result);
    }

    @Test
    public final void nullPrincipalReturnsNullAuthentication() throws Exception {
View Full Code Here

Examples of org.tinyradius.util.RadiusClient.authenticate()

    ar.addAttribute("Service-Type", "Login-User");
    ar.addAttribute("WISPr-Redirection-URL", "http://www.sourceforge.net/");
    ar.addAttribute("WISPr-Location-ID", "net.sourceforge.ap1");
   
    System.out.println("Packet before it is sent\n" + ar + "\n");
    RadiusPacket response = rc.authenticate(ar);
    System.out.println("Packet after it was sent\n" + ar + "\n");
    System.out.println("Response\n" + response + "\n");

    // 2. Send Accounting-Request
    AccountingRequest acc = new AccountingRequest("mw", AccountingRequest.ACCT_STATUS_TYPE_START);
View Full Code Here

Examples of org.tmatesoft.hg.auth.HgAuthenticator.authenticate()

      } catch (HgAuthFailedException ex) {
        // FALL THROUGH to try Authenticator
      }
    }
    HgAuthenticator auth = sessionCtx.getAuthenticator(rd);
    auth.authenticate(rd, authMediator);
  }

  public void disconnect() throws HgRemoteConnectionException, HgRuntimeException {
    // TODO Auto-generated method stub
View Full Code Here

Examples of org.uberfire.security.auth.AuthenticationManager.authenticate()

                    @Override
                    public boolean authenticate( String username,
                                                 String password,
                                                 Session session ) {
                        try {
                            final org.uberfire.security.Subject result = authenticationManager.authenticate( new UserPassSecurityContext( null, username, password ) );
                            if ( result != null ) {
                                session.setSubject( new SubjectWrapper( result ) );
                            }
                            return result != null;
                        } catch ( final Exception ignored ) {
View Full Code Here

Examples of org.voltdb.security.AuthenticationRequest.authenticate()

                    arq = context.authSystem.new HashAuthenticationRequest(username, password);
                }
                /*
                 * Authenticate the user.
                 */
                boolean authenticated = arq.authenticate();

                if (!authenticated) {
                    Exception faex = arq.getAuthenticationFailureException();

                    boolean isItIo = false;
View Full Code Here

Examples of org.wso2.carbon.bam.core.clients.AuthenticationAdminClient_2_0_2.authenticate()

        try {
            AuthenticationAdminClient_2_0_2 authenticationAdminClient_2_0_2 =
                    new AuthenticationAdminClient_2_0_2(server.getServerURL());

            isLoggedIn = authenticationAdminClient_2_0_2.authenticate(server.getUserName(), server.getPassword());

            if (isLoggedIn) {
                String sessionCookie = authenticationAdminClient_2_0_2.getSessionCookie();
                getSessionCache().addSessionString(server.getServerURL(), sessionCookie);
            }
View Full Code Here

Examples of org.wso2.carbon.bam.core.clients.AuthenticationAdminClient_2_0_3.authenticate()

        try {
            AuthenticationAdminClient_2_0_3 authenticationAdminClient_2_0_3 =
                    new AuthenticationAdminClient_2_0_3(server.getServerURL());

            isLoggedIn = authenticationAdminClient_2_0_3.authenticate(server.getUserName(), server.getPassword());

            if (isLoggedIn) {
                String sessionCookie = authenticationAdminClient_2_0_3.getSessionCookie();
                getSessionCache().addSessionString(server.getServerURL(), sessionCookie);
            }
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.