Package com.data2semantics.yasgui.shared

Examples of com.data2semantics.yasgui.shared.LoginResult


 
  public LoginResult login(String appBaseUrl, boolean inDebugMode, String openIdURL) throws FetchException {
    LOGGER.info("trying to log in for " + openIdURL);
    HttpServletRequest request = getThreadLocalRequest();
    LOGGER.info("we have the request. now pass it on to openid servlet");
    LoginResult loginResult = new LoginResult();
    try {
      UserDetails userDetails;
      userDetails = OpenIdServlet.getRequestUserInfo(new File(getServletContext().getRealPath("/")), request);
      if (userDetails.isLoggedIn()) {
        loginResult.setIsLoggedIn(true);
      } else {
        //not logged in
        loginResult.setIsLoggedIn(false);
        loginResult.setAuthenticationLink(OpenIdServlet.getAuthenticationURL(openIdURL, appBaseUrl, inDebugMode));
      }
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (FileNotFoundException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (JSONException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (SQLException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (IOException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (ParseException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (OpenIdException e) {
      //not logged in
      loginResult.setIsLoggedIn(false);
      loginResult.setAuthenticationLink(OpenIdServlet.getAuthenticationURL(openIdURL, appBaseUrl, inDebugMode));
    }
    return loginResult;
   
  }
View Full Code Here

TOP

Related Classes of com.data2semantics.yasgui.shared.LoginResult

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.