Package org.springframework.security.authentication

Examples of org.springframework.security.authentication.AuthenticationManager


      @Override
      public void onApplicationEvent(ApplicationEvent event) {
        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


    private AuthenticationManager authenticationManager;

    @Bean
    public AuthenticationManager myAuthenticationManager() {
      this.authenticationManager = new AuthenticationManager() {

        @Override
        public Authentication authenticate(Authentication authentication)
            throws AuthenticationException {
          return new TestingAuthenticationToken("foo", "bar");
View Full Code Here

    @SuppressWarnings("unused")
    private AuthenticationManager authenticationManager;

    @Override
    protected void configure(HttpSecurity http) throws Exception {
      this.authenticationManager = new AuthenticationManager() {
        @Override
        public Authentication authenticate(Authentication authentication)
            throws AuthenticationException {
          return WorkaroundSecurityCustomizer.this.builder.getOrBuild()
              .authenticate(authentication);
View Full Code Here

    private AuthenticationManager authenticationManager;

    @Bean
    public AuthenticationManager myAuthenticationManager() {
      this.authenticationManager = new AuthenticationManager() {

        @Override
        public Authentication authenticate(Authentication authentication)
            throws AuthenticationException {
          return new TestingAuthenticationToken("foo", "bar");
View Full Code Here

    public static final String PASSWORD = UUID.randomUUID().toString();

    @Bean
    public AuthenticationManager authenticationManager() {
      return new AuthenticationManager() {

        @Override
        public Authentication authenticate(Authentication authentication)
            throws AuthenticationException {
          if (authentication.getName().equals(USERNAME)
View Full Code Here

        clientCredentialsTokenEndpointFilter = new ClientCredentialsTokenEndpointFilter();
        clientCredentialsTokenEndpointFilter.setAuthenticationManager(http
                .getAuthenticationManager());
        clientCredentialsTokenEndpointFilter = postProcess(clientCredentialsTokenEndpointFilter);

        AuthenticationManager oauthAuthenticationManager = oauthAuthenticationManager(http);
        resourcesServerFilter = new OAuth2AuthenticationProcessingFilter();
        resourcesServerFilter.setAuthenticationManager(oauthAuthenticationManager);
        resourcesServerFilter = postProcess(resourcesServerFilter);

        this.tokenGranter = tokenGranter(http);
View Full Code Here

    private TokenGranter tokenGranter(HttpSecurity http) throws Exception {
        if(tokenGranter == null) {
            ClientDetailsService clientDetails = clientDetails();
            AuthorizationServerTokenServices tokenServices = tokenServices(http);
            AuthorizationCodeServices authorizationCodeServices = authorizationCodeServices(http);
            AuthenticationManager authenticationManager = authenticationManager(http);

            List<TokenGranter> tokenGranters = new ArrayList<TokenGranter>();
            tokenGranters.add(new AuthorizationCodeTokenGranter(tokenServices,
                    authorizationCodeServices, clientDetails));
            tokenGranters
View Full Code Here

        parentAuthenticationBuilder.objectPostProcessor(objectPostProcessor);

        DefaultAuthenticationEventPublisher eventPublisher = objectPostProcessor.postProcess(new DefaultAuthenticationEventPublisher());
        parentAuthenticationBuilder.authenticationEventPublisher(eventPublisher);

        AuthenticationManager authenticationManager = authenticationManager();
        authenticationBuilder.parentAuthenticationManager(authenticationManager);
        http = new HttpSecurity(objectPostProcessor,authenticationBuilder, parentAuthenticationBuilder.getSharedObjects());
        http.setSharedObject(UserDetailsService.class, userDetailsService());
        if(!disableDefaults) {
            http
View Full Code Here

        return this;
    }

    @Override
    public void configure(B http) throws Exception {
        AuthenticationManager authenticationManager = http.getAuthenticationManager();
        BasicAuthenticationFilter basicAuthenticationFilter = new BasicAuthenticationFilter(authenticationManager, authenticationEntryPoint);
        if(authenticationDetailsSource != null) {
            basicAuthenticationFilter.setAuthenticationDetailsSource(authenticationDetailsSource);
        }
        basicAuthenticationFilter = postProcess(basicAuthenticationFilter);
View Full Code Here

TOP

Related Classes of org.springframework.security.authentication.AuthenticationManager

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.