Package org.jboss.as.test.http

Source Code of org.jboss.as.test.http.Authentication

package org.jboss.as.test.http;

import java.net.Authenticator;
import java.net.PasswordAuthentication;

/**
* @author Stuart Douglas
*/
public class Authentication {

    public static final String USERNAME = "testSuite";
    public static final String PASSWORD = "testSuitePassword";


    public static Authenticator getAuthenticator() {
        return new Authenticator() {
            @Override
            protected PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication(USERNAME, PASSWORD.toCharArray());
            }
        };
    }

    public static void setupDefaultAuthenticator() {
        Authenticator.setDefault(getAuthenticator());
    }
}
TOP

Related Classes of org.jboss.as.test.http.Authentication

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.