Package org.orgama.server.auth.model

Examples of org.orgama.server.auth.model.AuthInitialization


 
 
  @Test
  public void testSuccessfulAuthenticationWithGoogleAccounts() {
   
    AuthInitialization authInitialization = new AuthInitialization();
    authInitialization.setAuthServiceName(AuthServiceName.googleAccounts);
    authInitialization.setEmailAddress(env.getEmailAddress());
    authInitialization.setState(AuthInitializationState.authenticating);
    authInitialization.setServiceSpecificUserId(env.getEmailAddress());
   
    //Register the user with the given auth Initialization
    userService.registerNewUser(authInitialization);
   
    httpSession.setAttribute(constants.getAuthInitializationKey(),
View Full Code Here


    assertNull(state.getAuthServiceName());
  }
 
  @Test
  public void testInvalidServiceNameOnRegistration() {
    AuthInitialization authInitialization = new AuthInitialization();
    authInitialization.setAuthServiceName("this is an error");
    authInitialization.setEmailAddress(env.getEmailAddress());
    authInitialization.setState(AuthInitializationState.registering);
   
    httpSession.setAttribute(constants.getAuthInitializationKey(),
        authInitialization);
   
   
View Full Code Here

        authState.getAuthState());
  }
 
  @Test
  public void testRegistrationWhenNotAuthenticated() {
    AuthInitialization authInitialization = new AuthInitialization();
    authInitialization.setAuthServiceName(AuthServiceName.googleAccounts);
    authInitialization.setEmailAddress(env.getEmailAddress());
    authInitialization.setState(AuthInitializationState.registering);
   
    httpSession.setAttribute(constants.getAuthInitializationKey(),
        authInitialization);
   
    ICompleteAuthState completeAuthState = bootstrapper.bootstrap();
View Full Code Here

        completeAuthState.getAuthServiceName());
  }
 
  @Test
  public void testInvalidServiceNameOnAuthentication() {
    AuthInitialization authInitialization = new AuthInitialization();
    authInitialization.setAuthServiceName("this is an error");
    authInitialization.setEmailAddress(env.getEmailAddress());
    authInitialization.setState(AuthInitializationState.authenticating);
   
    httpSession.setAttribute(constants.getAuthInitializationKey(),
        authInitialization);
   
   
View Full Code Here

        authState.getAuthState());
  }
 
  @Test
  public void testAuthenticationWhenNotAuthenticated() {
    AuthInitialization authInitialization = new AuthInitialization();
    authInitialization.setAuthServiceName(AuthServiceName.googleAccounts);
    authInitialization.setEmailAddress(env.getEmailAddress());
    authInitialization.setState(AuthInitializationState.authenticating);
   
    httpSession.setAttribute(constants.getAuthInitializationKey(),
        authInitialization);
   
    ICompleteAuthState completeAuthState = bootstrapper.bootstrap();
View Full Code Here

   * this method is called if there is no local copy
   * @return
   */
  private synchronized AuthInitialization getImpl() {
   
    AuthInitialization result = authInitialization;
   
    if (result != null) {
      return result;
    }
   
    HttpSession httpSession = httpSessionProvider.get();
   
    result = (AuthInitialization)httpSession.getAttribute(
        constants.getAuthInitializationKey());
   
   
    if (result != null) {
      return result;
    }
   
    result = new AuthInitialization();
    httpSession.setAttribute(
        constants.getAuthInitializationKey(), result);

    return result;
  }
View Full Code Here

     * one
     * @return
     */
    @Override
    public AuthInitialization get() {
      AuthInitialization result = naturalService.get();
     
      if (result.getState() != AuthInitializationState.nil) {
       
        synchronized(this) {
          result = naturalService.get();
          if (result.getState() != AuthInitializationState.nil) {
            naturalService.clear();
            result = naturalService.get();
          }

        }
View Full Code Here

  }
 
  @Test
  public void testDuplicateEmailAddressOnRegistration() {
   
    AuthInitialization authInitialization = new AuthInitialization();
    authInitialization.setAuthServiceName(AuthServiceName.googleAccounts);
    authInitialization.setEmailAddress(env.getEmailAddress());
    authInitialization.setState(AuthInitializationState.registering);
    authInitialization.setServiceSpecificUserId(env.getEmailAddress());
   
   
    //Register the user with the given auth Initialization
    userService.registerNewUser(authInitialization);
   
   
    authInitialization.setServiceSpecificUserId(
        env.getEmailAddress() + ".other");
   
    httpSession.setAttribute(constants.getAuthInitializationKey(),
        authInitialization);
   
View Full Code Here

  }
 
  @Test
  public void testDuplicateExternalIdOnRegistration() {
   
    AuthInitialization authInitialization = new AuthInitialization();
    authInitialization.setAuthServiceName(AuthServiceName.googleAccounts);
    authInitialization.setEmailAddress(env.getEmailAddress());
    authInitialization.setState(AuthInitializationState.registering);
    authInitialization.setServiceSpecificUserId(env.getEmailAddress());
   
   
    //Register the user with the given auth Initialization
    userService.registerNewUser(authInitialization);
   
    authInitialization.setEmailAddress("other." +
        env.getEmailAddress());
   
    httpSession.setAttribute(constants.getAuthInitializationKey(),
        authInitialization);
   
View Full Code Here

  }
 
  @Test
  public void testExternalMismatchOnAuthentication() {
   
    AuthInitialization authInitialization = new AuthInitialization();
    authInitialization.setAuthServiceName(AuthServiceName.googleAccounts);
    authInitialization.setEmailAddress(env.getEmailAddress());
    authInitialization.setState(AuthInitializationState.authenticating);
    authInitialization.setServiceSpecificUserId(env.getEmailAddress());
   
   
    //Register the user with the given auth Initialization
    userService.registerNewUser(authInitialization);
   
    authInitialization.setServiceSpecificUserId("other." +
        env.getEmailAddress());
   
    httpSession.setAttribute(constants.getAuthInitializationKey(),
        authInitialization);
   
View Full Code Here

TOP

Related Classes of org.orgama.server.auth.model.AuthInitialization

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.