Examples of AuthSession


Examples of com.rsa.authagent.authapi.AuthSession

    {
        boolean valid = false;
        try
        {
            AuthSessionFactory api = AuthSessionFactory.getInstance(configPath);
            AuthSession authSession = api.createUserSession();
            int status = authSession.check(username, password);
            authSession.close();
            api.shutdown();
            valid = (status == AuthSession.ACCESS_OK);
        }
        catch (Exception e)
        {
View Full Code Here

Examples of org.orgama.shared.auth.model.AuthSession

 
    assertNotNull(result);
    assertNotNull(result.getRedirectUrl());
    assertEquals("http://127.0.0.1:8888", result.getRedirectUrl());
   
    AuthSession session = sessionService.get();
   
    assertNull(session);
  }
View Full Code Here

Examples of org.orgama.shared.auth.model.AuthSession

    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

Examples of org.orgama.shared.auth.model.AuthSession

    Logger.debug("Validating " + a.getEmailAddress());

    String emailAddress = a.getEmailAddress();

    AuthSession session = sessionProviderProvider.get().get();

    if (session != null) {
      throw new AlreadyAuthenticatedException();
    }
View Full Code Here

Examples of org.orgama.shared.auth.model.AuthSession

 
  @Override
  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);
        }
      }
     
    }
View Full Code Here

Examples of org.orgama.shared.auth.model.AuthSession

   
    String emailAddress = a.getEmailAddress();
    String authResourceName = a.getAuthResourceName();
   
    //Check that the user is not already logged in
    AuthSession session = sessionProviderProvider.get().get();
   
    if (session != null) {
      throw new AlreadyAuthenticatedException();
    }
   
View Full Code Here

Examples of org.orgama.shared.auth.model.AuthSession

  public void testBehaviorWithValidSession() {
    String sessionId = "seasdfasdfaagagag";
   
    {
      cookieHandler.setValue(constants.getSessionCookieName(), sessionId);
      AuthSession authSession = new AuthSession();
      authSession.setExpirationDate(
          new Date(new Date().getTime() + 1000000));
      authSession.setSessionId(sessionId);
      authSession.setUserId(1);
      Ofy.save().entity(authSession).now();
    }
   
    ICompleteAuthState state = bootstrapper.bootstrap();
   
View Full Code Here

Examples of org.orgama.shared.auth.model.AuthSession

   
    String sessionId = "seasdfasdfaagagag";
   
    {
      cookieHandler.setValue(constants.getSessionCookieName(), sessionId);
      AuthSession authSession = new AuthSession();
      authSession.setExpirationDate(
          new Date(new Date().getTime() - 1000000)); //Expired
      authSession.setSessionId(sessionId);
      authSession.setUserId(1);
      Ofy.save().entity(authSession).now();
    }
   
    ICompleteAuthState state = bootstrapper.bootstrap();
   
View Full Code Here

Examples of org.orgama.shared.auth.model.AuthSession

  public void testBehaviorOnActualError() {
    String sessionId = "seasdfasdfaagagag";
   
    {
      cookieHandler.setValue(constants.getSessionCookieName(), sessionId);
      AuthSession authSession = new AuthSession();
      authSession.setExpirationDate(
          new Date(new Date().getTime() + 1000000));
      authSession.setSessionId(sessionId);
      authSession.setUserId(1);
      Ofy.save().entity(authSession).now();
    }
   
    //Set the cookie handler to throw an error on get
    ((MockCookieHandler)cookieHandler).setThrowErrorOnGet(true);
View Full Code Here

Examples of org.orgama.shared.auth.model.AuthSession

   * then null is returned. 
   * @return
   */
  @Override
  public AuthSession get() {
    AuthSession result = getImpl();
   
    if (result != null) {
      validateAuthSession(result);
    }
   
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.