Package org.orgama.shared.auth.action

Examples of org.orgama.shared.auth.action.SignOutResult


    SignOut action = new SignOut();
    action.setAuthServiceName(AuthServiceName.googleAccounts);
    action.setSignOutOfApp(true);
    action.setSignOutOfExternalService(false);
   
    SignOutResult result = (SignOutResult)dispatch.execute(null, action);
 
    assertNotNull(result);
    assertNotNull(result.getRedirectUrl());
    assertEquals("http://127.0.0.1:8888", result.getRedirectUrl());
   
    action = new SignOut();
    action.setAuthServiceName(AuthServiceName.googleAccounts);
    action.setSignOutOfApp(false);
    action.setSignOutOfExternalService(true);
   
    result = (SignOutResult)dispatch.execute(null, action);
 
    assertNotNull(result);
    assertNotNull(result.getRedirectUrl());
    assertEquals("/_ah/logout?continue=http%3A%2F%2F127.0.0.1%3A8888",
        result.getRedirectUrl());
   
    action = new SignOut();
    action.setAuthServiceName(AuthServiceName.googleAccounts);
    action.setSignOutOfApp(true);
    action.setSignOutOfExternalService(true);
   
    result = (SignOutResult)dispatch.execute(null, action);
 
    assertNotNull(result);
    assertNotNull(result.getRedirectUrl());
    assertEquals("/_ah/logout?continue=http%3A%2F%2F127.0.0.1%3A8888",
        result.getRedirectUrl());
   
  }
View Full Code Here


    SignOut action = new SignOut();
    action.setAuthServiceName(AuthServiceName.googleAccounts);
    action.setSignOutOfApp(true);
    action.setSignOutOfExternalService(false);
   
    SignOutResult result = (SignOutResult)dispatch.execute(null, action);
 
    assertNotNull(result);
    assertNotNull(result.getRedirectUrl());
    assertEquals("http://127.0.0.1:8888", result.getRedirectUrl());
   
    AuthSession session = sessionService.get();
   
    assertNull(session);
  }
View Full Code Here

    SignOut action = new SignOut();
    action.setAuthServiceName(AuthServiceName.googleAccounts);
    action.setSignOutOfApp(true);
    action.setSignOutOfExternalService(true);
   
    SignOutResult result = (SignOutResult)dispatch.execute(null, action);
 
    assertNotNull(result);
    assertNotNull(result.getRedirectUrl());
    assertEquals("/_ah/logout?continue=http%3A%2F%2F127.0.0.1%3A8888",
        result.getRedirectUrl());
   
    AuthSession session = sessionService.get();
   
    assertNull(session);
  }
View Full Code Here

  public SignOutResult execImpl(SignOut a, ExecutionContext ec) {
   
    ICoreSessionService sessionService = sessionServicesProvider.get();
    AuthSession authSession = sessionService.get();
    String alternateRedirectUrl = null;
    SignOutResult result = new SignOutResult();
   
    if (a.isSignOutOfApp()) {
      if (authSession == null) {
        Logger.warn("Requested to log out of app when not logged in");
      }
      else {
        sessionService.close(authSession);
      }
    }
   
    if (a.isSignOutOfExternalService()) {
      String authServiceName = null;
     
      if (authSession != null) {
        authServiceName = authSession.getAuthServiceName();
      }
      else {
        authServiceName = a.getAuthServiceName();
      }
     
      if (authServiceName == null) {
        Logger.warn("No auth service could be found to log out of");
      }
      else {
        IAuthService service =
            serviceProvider.getAuthServices().get(authServiceName);
        if (service != null) {
          alternateRedirectUrl = service.getSignOutUrl(
              authSession != null
              ? authSession.getServiceSpecificSessionId()
              : null);
        }
      }
     
    }
   
    if (alternateRedirectUrl != null) {
      result.setRedirectUrl(alternateRedirectUrl);
    }
    else {
      result.setRedirectUrl(getDefaultUrl());
    }
   
    return result;
  }
View Full Code Here

TOP

Related Classes of org.orgama.shared.auth.action.SignOutResult

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.