Package org.springframework.security.authentication

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


            public SAMLMessageContext answer() throws Throwable {
                context.getValue().setInboundSAMLBinding(org.opensaml.common.xml.SAMLConstants.SAML2_POST_BINDING_URI);
                return context.getValue();
            }
        });
        expect(manager.authenticate((Authentication) notNull())).andReturn(token);

        replay(manager);
        replayMock();
        Authentication authentication = processingFiler.attemptAuthentication(request, null);
        assertEquals(token, authentication);
View Full Code Here


  @Before
  public void init() {
    AuthenticationManager authenticationManager = this.context
        .getBean(AuthenticationManager.class);
    this.authentication = authenticationManager
        .authenticate(new UsernamePasswordAuthenticationToken("user", "password"));
  }

  @After
  public void close() {
View Full Code Here

      AuthenticationManager authenticationManager =
        ((SpringSecureWicketApplication) Application.get()).getAuthenticationManager();
      if (authenticationManager == null)
        throw new LoginException(
          "AuthenticationManager is not available, check if your spring config contains a property for the authenticationManager in your wicketApplication bean.");
      Authentication authResult = authenticationManager.authenticate(token);
      setAuthentication(authResult);
    }

    catch (RuntimeException e)
    {
View Full Code Here

        wrapper.set(event);
      };
    });
    AuthenticationManager manager = this.context.getBean(AuthenticationManager.class);
    try {
      manager.authenticate(new UsernamePasswordAuthenticationToken("foo", "bar"));
      fail("Expected BadCredentialsException");
    }
    catch (BadCredentialsException e) {
      // expected
    }
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.