Package org.nemesis.forum

Examples of org.nemesis.forum.Authorization


  public static Authorization getUserAuthorization(HttpServletRequest request, HttpServletResponse response, boolean checkCookie) {
    // we can get the session object from the request object:
    HttpSession session = request.getSession();

    // Check 1: check for the  authentication token in the user's session.
    Authorization authToken = (Authorization) session.getAttribute(AUTH_TOKEN);
    if (authToken != null) {
      return authToken;
    }

    // Check 2: check the  cookie for username and password, if we're allowing that
View Full Code Here


    String username,
    String password,
    boolean autoLogin)
    throws NotFoundException, UnauthorizedException {
    HttpSession session = request.getSession();
    Authorization authToken = AuthorizationFactory.getAuthorization(username, password);
    session.setAttribute(AUTH_TOKEN, authToken);

    if (autoLogin) {
      CookieManager.setCookie(response, AUTOLOGIN_COOKIE, CookieManager.encodePasswordCookie(username, password), CookieManager.MAX_COOKIE_AGE);
    }
View Full Code Here

  protected void authenticate(HttpServletRequest request, String login, String pass) throws UserNotLoggedException {

    try {

      Authorization token = AuthorizationFactory.getAuthorization(login, pass);

      boolean isBOUser =
        SecurityTools.isSystemAdmin(token)
          || SecurityTools.isForumAdmin(token)
          || SecurityTools.isGroupAdmin(token)
View Full Code Here

TOP

Related Classes of org.nemesis.forum.Authorization

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.