Examples of AuthenticationEvent


Examples of org.gatein.wci.authentication.AuthenticationEvent

      if (remoteUser  == null)
      {
         try
         {
            registration.context.login(request, response, credentials);
            fireEvent(new AuthenticationEvent(AuthenticationEventType.LOGIN,
                  request, response, credentials.getUsername(), credentials, registration.context));
         }
         catch (AuthenticationException ae)
         {
            fireEvent(new AuthenticationEvent(AuthenticationEventType.FAILED,
                  request, response, credentials.getUsername(), credentials, registration.context));
            throw ae;
         }
      }
      else
View Full Code Here

Examples of org.gatein.wci.authentication.AuthenticationEvent

   @InSequence(3)
   public void testAuthenticationFailure()
   {
      Assert.assertNull(AuthenticationServlet.remoteUser);
      Assert.assertEquals(1, AuthenticationServlet.authEvents.size());
      AuthenticationEvent event = AuthenticationServlet.authEvents.removeFirst();
      Assert.assertEquals(AuthenticationEventType.FAILED, event.getType());
      AuthenticationServlet.status = 2;
   }
View Full Code Here

Examples of org.gatein.wci.authentication.AuthenticationEvent

   @InSequence(5)
   public void testUserIsAuthenticated()
   {
      Assert.assertEquals("foo", AuthenticationServlet.remoteUser);
      Assert.assertEquals(1, AuthenticationServlet.authEvents.size());
      AuthenticationEvent event = AuthenticationServlet.authEvents.removeFirst();
      Assert.assertEquals(AuthenticationEventType.LOGIN, event.getType());
      Assert.assertEquals("foo", event.getCredentials().getUsername());
      Assert.assertEquals("bar", event.getCredentials().getPassword());
      AuthenticationServlet.status = 3;
   }
View Full Code Here

Examples of org.olat.login.auth.AuthenticationEvent

    if (event == Event.CANCELLED_EVENT) {
      // is a Form cancelled, show Login Form
      content = initLoginContent(ureq, null);
      dmzPanel.setContent(content);
    }else if (event instanceof AuthenticationEvent) {
      AuthenticationEvent authEvent = (AuthenticationEvent)event;
      Identity identity = authEvent.getIdentity();
      int loginStatus = AuthHelper.doLogin(identity, OLATAuthenticationController.PROVIDER_OLAT, ureq);
      if (loginStatus == AuthHelper.LOGIN_OK) {
        return;
      } else if (loginStatus == AuthHelper.LOGIN_NOTAVAILABLE){
        //getWindowControl().setError(translate("login.notavailable", OLATContext.getSupportaddress()));
View Full Code Here

Examples of org.sonatype.security.events.AuthenticationEvent

  @Override
  public Subject login(Subject subject, final AuthenticationToken token) throws AuthenticationException {
    try {
      subject = super.login(subject, token);
      UserIdMdcHelper.set(subject);
      eventBus.get().post(new AuthenticationEvent(token.getPrincipal().toString(), true));
      return subject;
    }
    catch (AuthenticationException e) {
      eventBus.get().post(new AuthenticationEvent(token.getPrincipal().toString(), false));
      throw e;
    }
  }
View Full Code Here

Examples of org.springframework.richclient.security.AuthenticationEvent

        // Commit the successful Authentication object to the secure ContextHolder
        SecurityContextHolder.getContext().setAuthentication( result );
        setAuthentication( result );

        // Fire application events to advise of new login
        appCtx.publishEvent( new AuthenticationEvent( result ) );
        appCtx.publishEvent( new LoginEvent( result ) );

        return result;
    }
View Full Code Here

Examples of org.springframework.richclient.security.AuthenticationEvent

        SecurityContextHolder.getContext().setAuthentication( null );
        setAuthentication( null );

        // Fire application event to advise of logout
        ApplicationContext appCtx = Application.instance().getApplicationContext();
        appCtx.publishEvent( new AuthenticationEvent( null ) );
        appCtx.publishEvent( new LogoutEvent( existing ) );

        return existing;
    }
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.