Package org.orgama.shared.auth.action

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


    }
 
  @Override
  public InitiateRegistrationResult execImpl(InitiateRegistration a,
      ExecutionContext ec) {
    InitiateRegistrationResult result = new InitiateRegistrationResult();
   
    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();
    }
   
    //Doublecheck that no users already have the given email address
    AuthUser user = userServices.getUserFromEmailAddress(emailAddress);
   
    if (user != null) {
      throw new EmailAddressTakenException();
    }
   
    AuthInitializationService authInitService =
        this.initProviderProvider.get();
   
    AuthInitialization authInit = authInitService.get();
   
    IAuthService authService =
        authSourceProvider.getAuthServices().get(authResourceName);
   
    if (authService == null) {
      throw new AuthException("No auth service could be found matching: "
          + authResourceName);
    }
   
    HttpServletResponse response = responseProvider.get();
   
    if (response == null) {
      throw new OrgamaCoreException("Failed to get HttpResponse");
    }
   
    String signInUrl = authService.getSignInUrl();
   
    result.setRedirectUrl(signInUrl);
   
    authInit.setEmailAddress(emailAddress);
    authInit.setState(AuthInitializationState.registering);
    authInit.setAuthServiceName(authResourceName);
   
View Full Code Here


    InitiateRegistration registration = new InitiateRegistration();
   
    registration.setAuthResourceName(AuthServiceName.googleAccounts);
    registration.setEmailAddress(emailAddress1);
   
    InitiateRegistrationResult result =
        (InitiateRegistrationResult)dispatch.execute(
            null, registration);
   
    assertNotNull(result);
    assertEquals("/_ah/login?continue=http%3A%2F%2F127.0.0.1%3A8888",
        result.getRedirectUrl());
   
    AuthInitialization authInit = authInitService.get();
   
    assertNotNull(authInit);
   
View Full Code Here

TOP

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

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.