Examples of AuthManager


Examples of org.apache.jmeter.protocol.http.control.AuthManager

    }

    private int getHeaderSize(String method, URL url) {
        HeaderManager headers = getHeaderManager();
        CookieManager cookies = getCookieManager();
        AuthManager auth = getAuthManager();
        int hsz = 1; // Host always
        if(method.equals(POST)) {
            String fn = getFilename();
            if(fn != null && fn.trim().length() > 0) {
                hsz += 3;
            } else {
                hsz += 2;
            }
        }
        if(headers != null) {
            hsz += headers.size();
        }
        if(cookies != null) {
            hsz += cookies.getCookieCount();
        }
        if(auth != null) {
                String authHeader = auth.getAuthHeaderForURL(url);
            if(authHeader != null) {
            ++hsz;
            }
        }
        return hsz;
View Full Code Here

Examples of sample.logic.AuthManager

    // switch between both authroization methods simply replace retrieving a AuthManager
    // instance with the getOauthManager method for the getAuthSubManager method. This can be
    // done by uncommenting the code below. There is a similar change that must occur in the
    // MainServlet class.

    AuthManager authManager = AuthManagerFactory.getAuthSubManager();
    //AuthManager authManager = AuthManagerFactory.getOauthManager();
    String nextUrl = "";

    if (request.getParameter(authManager.getTokenParam()) != null) {
      // The user is being redirected back from google.com to exchange the AuthSub one time
      // use token for a session token.
      authManager.storeAuthorizedToken(request.getQueryString());
      nextUrl = MainServlet.MAIN_URL;

    } else if (request.getParameter("action") != null) {

      if (request.getParameter("action").equals("revoke")) {
        // The user is revoking their token.
        authManager.revokeToken();
        nextUrl = MainServlet.MAIN_URL;

      } else if (request.getParameter("action").equals("authorize")) {
        // The user is starting the AuthSub authorization process.
        nextUrl = authManager.getAuthorizationRedirectUrl(request.getRequestURL());
      }
    }

    GoogleData googleData = authManager.getGoogleData();

    if (googleData.getAuthorizationErrorMessage() != null) {
      // Forward users to the authorization page.
      request.setAttribute("googleData", googleData);
      ServletContext sc = getServletContext();
View Full Code Here

Examples of spanishgringo.logic.AuthManager

    // switch between both authroization methods simply replace retrieving a AuthManager
    // instance with the getOauthManager method for the getAuthSubManager method. This can be
    // done by uncommenting the code below. There is a similar change that must occur in the
    // MainServlet class.

    AuthManager authManager = AuthManagerFactory.getAuthSubManager();
    //AuthManager authManager = AuthManagerFactory.getOauthManager();
    String nextUrl = "";

    if (request.getParameter(authManager.getTokenParam()) != null) {
      // The user is being redirected back from google.com to exchange the AuthSub one time
      // use token for a session token.
      authManager.storeAuthorizedToken(request.getQueryString());
      nextUrl = MainServlet.MAIN_URL;

    } else if (request.getParameter("action") != null) {

      if (request.getParameter("action").equals("revoke")) {
        // The user is revoking their token.
        authManager.revokeToken();
        nextUrl = MainServlet.MAIN_URL;

      } else if (request.getParameter("action").equals("authorize")) {
        // The user is starting the AuthSub authorization process.
        nextUrl = authManager.getAuthorizationRedirectUrl(request.getRequestURL());
      }
    }

    GoogleData googleData = authManager.getGoogleData();

    if (googleData.getAuthorizationErrorMessage() != null) {
      // Forward users to the authorization page.
      request.setAttribute("googleData", googleData);
      ServletContext sc = getServletContext();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.