Examples of AuthenticationSuccessEvent


Examples of org.acegisecurity.event.authentication.AuthenticationSuccessEvent

                    result = null;
                }

                if (result != null) {
                    sessionController.registerSuccessfulAuthentication(result);
                    publishEvent(new AuthenticationSuccessEvent(result));

                    return result;
                }
            }
        }
View Full Code Here

Examples of org.acegisecurity.event.authentication.AuthenticationSuccessEvent

                    result = null;
                }

                if (result != null) {
                    sessionController.registerSuccessfulAuthentication(result);
                    applicationEventPublisher.publishEvent(new AuthenticationSuccessEvent(
                            result));

                    return result;
                }
            }
View Full Code Here

Examples of org.glyptodon.guacamole.net.event.AuthenticationSuccessEvent

     */
    private boolean notifySuccess(Collection listeners, UserContext context,
            Credentials credentials) throws GuacamoleException {

        // Build event for auth success
        AuthenticationSuccessEvent event =
                new AuthenticationSuccessEvent(context, credentials);

        // Notify all listeners
        for (Object listener : listeners) {
            if (listener instanceof AuthenticationSuccessListener) {

View Full Code Here

Examples of org.springframework.security.authentication.event.AuthenticationSuccessEvent

                AuthenticationFailureProxyUntrustedEvent.class);
    }

    public void publishAuthenticationSuccess(Authentication authentication) {
        if (applicationEventPublisher != null) {
            applicationEventPublisher.publishEvent(new AuthenticationSuccessEvent(authentication));
        }
    }
View Full Code Here

Examples of org.springframework.security.authentication.event.AuthenticationSuccessEvent

    @Test
    public void targetDoesntLoseApplicationListenerInterface() {
        assertEquals(1, appContext.getBeansOfType(ApplicationListener.class).size());
        assertEquals(1, appContext.getBeanNamesForType(ApplicationListener.class).length);
        appContext.publishEvent(new AuthenticationSuccessEvent(new TestingAuthenticationToken("user", "")));

        assertTrue(target instanceof ApplicationListener<?>);
    }
View Full Code Here

Examples of org.springframework.security.authentication.event.AuthenticationSuccessEvent

        super.setUp();
    }

    public void testAbstractAuthenticationEvent() {
        Authentication auth = getAuthentication();
        AbstractAuthenticationEvent event = new AuthenticationSuccessEvent(auth);
        assertEquals(auth, event.getAuthentication());
    }
View Full Code Here

Examples of org.springframework.security.authentication.event.AuthenticationSuccessEvent

                AuthenticationFailureProxyUntrustedEvent.class.getName());
    }

    public void publishAuthenticationSuccess(Authentication authentication) {
        if (applicationEventPublisher != null) {
            applicationEventPublisher.publishEvent(new AuthenticationSuccessEvent(authentication));
        }
    }
View Full Code Here

Examples of org.springframework.security.authentication.event.AuthenticationSuccessEvent

    this.listener.setApplicationEventPublisher(this.publisher);
  }

  @Test
  public void testAuthenticationSuccess() {
    this.listener.onApplicationEvent(new AuthenticationSuccessEvent(
        new UsernamePasswordAuthenticationToken("user", "password")));
    verify(this.publisher).publishEvent((ApplicationEvent) anyObject());
  }
View Full Code Here

Examples of org.springframework.security.event.authentication.AuthenticationSuccessEvent

  protected void onSuccessfulAuthentication( HttpServletRequest request, HttpServletResponse response,
                                             Authentication authResult ) throws IOException {
    super.onSuccessfulAuthentication( request, response, authResult );
    request.getSession().setAttribute( "BasicAuth", "true" );
    if ( applicationEventPublisher != null ) {
      applicationEventPublisher.publishEvent( new AuthenticationSuccessEvent( authResult ) );
    }
  }
View Full Code Here

Examples of org.springframework.security.event.authentication.AuthenticationSuccessEvent

            if (event instanceof AbstractAuthenticationFailureEvent) {
                LOGGER.warn("Erreur d'authentification: {}", new Object[]{event});
            }

            if (event instanceof AuthenticationSuccessEvent) {
                AuthenticationSuccessEvent authenticationSuccessEvent = (AuthenticationSuccessEvent) event;
                String username = authenticationSuccessEvent.getAuthentication().getName();
                User user = userAuthService.findUserByUserName(username);
                // sauvergarde en session de la précédente date de connexion
                HttpServletRequest request = (HttpServletRequest) ( (ServletRequestAttributes) RequestContextHolder.getRequestAttributes() ).getRequest();
                request.getSession().setAttribute("lastLogin", user.getLastLogin());
                // mise à jour de la date de connexion.
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.