Package org.orgama.server.auth.source

Examples of org.orgama.server.auth.source.IAuthService


      //auth service's login url.

      String serviceName = user.getAuthServiceName();
      emailAddress = user.getSanitizedEmailAddress();

      IAuthService authService = authSources.get(serviceName);

      if (authService == null) {
        throw new AuthException("The auth service that user: "
            + emailAddress + " used to "
            + "authenticate, " + serviceName + " "
            + "was not found in the list of auth sources");
      }

      authInit.setAuthServiceName(serviceName);
      authInit.setEmailAddress(emailAddress);
      authInit.setState(AuthInitializationState.authenticating);
      authInit.setServiceSpecificUserId(user.getServiceSpecificUserId());

      authInitService.save(authInit);

      result = new ValidateEmailAddressResult(authService.getSignInUrl());
    }

    return result;
  }
View Full Code Here


     
      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

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

   * used by the user has already been taken
   */
  private AuthState handleRegistration(
      AuthInitialization authInit) {
   
    IAuthService service = serviceProvider.getAuthServices().get(
        authInit.getAuthServiceName());
   
    authInitService.clear();
     
    if (service == null) {
      throw new AuthException("No authentication service was " +
          "registered with the resource name: " +
          authInit.getAuthServiceName());
    }
   
    String serviceSpecificSessionId = service.getServiceSpecificSessionId();
   
    //If the user comes back to the site without being authenticated (the
    //nerve), then the new auth state is "registrationFailed".  This is
    //returned as part of the compelte auth state and allows the app to
    //decide how this information is presented and handled
    if (Strings.isNullOrEmpty(serviceSpecificSessionId)) {
      return AuthState.externalAuthenticationFailed;
    }
   
    String serviceSpecificUserId =
        service.getServiceSpecificUserId(serviceSpecificSessionId);
   
    //At this point we are pretty certain the user is logged in because we
    //have a service-specific sessionId.  However some services don't use
    //a service specific session Id, so we have to verify that the retrtied
    //service-specific user id is valid.
View Full Code Here

   * @param authInit
   * @return
   */
  private AuthState handleAuthentication(AuthInitialization authInit) {
   
    IAuthService service = serviceProvider.getAuthServices().get(
        authInit.getAuthServiceName());
   
    authInitService.clear();
     
    if (service == null) {
      throw new AuthException("No authentication service was " +
          "registered with the resource name: " +
          authInit.getAuthServiceName());
    }
   
    String serviceSpecificSessionId = service.getServiceSpecificSessionId();
   
    //If the user comes back to the site without being authenticated (the
    //nerve), then the new auth state is "authenticationFailed".  This is
    //returned as part of the compelte auth state and allows the app to
    //decide how this information is presented and handled
    if (Strings.isNullOrEmpty(serviceSpecificSessionId)) {
      return AuthState.externalAuthenticationFailed;
    }
   
    String serviceSpecificUserId =
        service.getServiceSpecificUserId(serviceSpecificSessionId);
   
    //At this point we are pretty certain the user is logged in because we
    //have a service-specific sessionId.  However some services don't use
    //a service specific session Id, so we have to verify that the retrtied
    //service-specific user id is valid.
View Full Code Here

TOP

Related Classes of org.orgama.server.auth.source.IAuthService

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.