Package com.sun.enterprise.admin.util

Examples of com.sun.enterprise.admin.util.AuthenticationInfo


        }
    }

    @Override
    protected AuthenticationInfo authenticationInfo() {
        AuthenticationInfo result = null;
        if (SecureAdmin.Util.isUsingUsernamePasswordAuth(secureAdmin)) {
            final SecureAdminInternalUser secureAdminInternalUser = SecureAdmin.Util.secureAdminInternalUser(secureAdmin);
            if (secureAdminInternalUser != null) {
                try {
                    String pw = masterPassword().getMasterPasswordAdapter().getPasswordForAlias(secureAdminInternalUser.getPasswordAlias());
                    result = new AuthenticationInfo(secureAdminInternalUser.getUsername(), pw);
                    pw = null;
                } catch (Exception ex) {
                    throw new RuntimeException(ex);
                }
            }
View Full Code Here


                    logger.log(Level.FINER, "URL: {0}", url.toURL(uriString).toString());
                    logger.log(Level.FINER, "Password options: {0}", passwordOptions);
                    logger.log(Level.FINER, "Using auth info: User: {0}, Password: {1}",
                            new Object[]{user, ok(password) ? "<non-null>" : "<null>"});
                }
                final AuthenticationInfo authInfo = authenticationInfo();
                if (authInfo != null) {
                    url.setAuthenticationInfo(authInfo);
                }
                urlConnection = (HttpURLConnection) url.openConnection(uriString);
                urlConnection.setRequestProperty("User-Agent", responseFormatType);
View Full Code Here

     * in building the outbound HTTP connection.
     *
     * @return the username/password auth. information to send with the request
     */
    protected AuthenticationInfo authenticationInfo() {
        return ((user != null || password != null) ? new AuthenticationInfo(user, password) : null);
    }
View Full Code Here

                logger.log(Level.FINER, "URL: {0}", url.toURL(uriString).toString());
                logger.log(Level.FINER, "Password options: {0}", passwordOptions);
                logger.log(Level.FINER, "Using auth info: User: {0}, Password: {1}",
                        new Object[]{user, ok(password) ? "<non-null>" : "<null>"});

                final AuthenticationInfo authInfo = authenticationInfo();
                if (authInfo != null) {
                    url.setAuthenticationInfo(authInfo);
                }
                urlConnection = (HttpURLConnection)
                        url.openConnection(uriString.toString());
View Full Code Here

     * in building the outbound HTTP connection.
     *
     * @return the username/password auth. information to send with the request
     */
    protected AuthenticationInfo authenticationInfo() {
        return ((user != null || password != null) ? new AuthenticationInfo(user, password) : null);
    }
View Full Code Here

        }
    }

    @Override
    protected AuthenticationInfo authenticationInfo() {
        AuthenticationInfo result = null;
        if (SecureAdmin.Util.isUsingUsernamePasswordAuth(secureAdmin)) {
            final SecureAdminInternalUser secureAdminInternalUser = SecureAdmin.Util.secureAdminInternalUser(secureAdmin);
            if (secureAdminInternalUser != null) {
                try {
                    String pw = masterPassword().getMasterPasswordAdapter().getPasswordForAlias(secureAdminInternalUser.getPasswordAlias());
                    result = new AuthenticationInfo(secureAdminInternalUser.getUsername(), pw);
                    pw = null;
                } catch (Exception ex) {
                    throw new RuntimeException(ex);
                }
            }
View Full Code Here

        public HttpURLConnection getHttpURLConnection(URL url) throws IOException {
            final Domain domain = habitat.getComponent(Domain.class);
            SecureAdmin secureAdmin = domain.getSecureAdmin();
            final String certAlias = SecureAdmin.Util.isUsingUsernamePasswordAuth(secureAdmin) ? null : SecureAdmin.Util.DASAlias(secureAdmin);
            HttpConnectorAddress httpConnectorAddress = new HttpConnectorAddress(habitat.getComponent(SSLUtils.class).getAdminSocketFactory(certAlias, "TLS"));
            AuthenticationInfo authenticationInfo = authenticationInfo(habitat, secureAdmin);
            if (authenticationInfo != null) {
                httpConnectorAddress.setAuthenticationInfo(authenticationInfo);
            }
            HttpURLConnection httpURLConnection = (HttpURLConnection) httpConnectorAddress.openConnection(url); // The URL constructed for REST will always be Http(s) so, it is ok to cast here.
            //TODO following code is copied from ServerRemoteAdminCommand.addAdditionalHeaders. When the clean up happens on trunk. this code needs to be accounted for.
View Full Code Here

         * Code in this method is copied from ServerRemoteAdminCommand to make it easier for sustaining to port back
         * these changes. In trunk, HttpConnectorAddress will be refactored such that all the code below will be
         * abstracted into HttpConnectorAddress.
         */
        private AuthenticationInfo authenticationInfo(Habitat habitat, SecureAdmin secureAdmin) {
            AuthenticationInfo result = null;
            if (SecureAdmin.Util.isUsingUsernamePasswordAuth(secureAdmin)) {
                final SecureAdminInternalUser secureAdminInternalUser = SecureAdmin.Util.secureAdminInternalUser(secureAdmin);
                if (secureAdminInternalUser != null) {
                    try {
                        String pw = habitat.getComponent(MasterPassword.class).getMasterPasswordAdapter().getPasswordForAlias(secureAdminInternalUser.getPasswordAlias());
                        result = new AuthenticationInfo(secureAdminInternalUser.getUsername(), pw);
                    } catch (Exception ex) {
                        throw new RuntimeException(ex);
                    }
                }
            }
View Full Code Here

                if (logger.isLoggable(Level.FINER)) {
                    logger.log(Level.FINER, "URI: {0}", uri.toString());
                    logger.log(Level.FINER, "Using auth info: User: {0}, Password: {1}",
                            new Object[]{user, ok(password) ? "<non-null>" : "<null>"});
                }
                final AuthenticationInfo authInfo = authenticationInfo();
                if (authInfo != null) {
                    HttpBasicAuthFilter besicAuth = new HttpBasicAuthFilter(authInfo.getUser(), authInfo.getPassword() == null ? "" : authInfo.getPassword());
                    target.configuration().register(besicAuth);
                }
                Metrix.event("doRestCommand() - about to prepare request builder");
                Builder request = target.request(acceptedResponseTypes);
                Metrix.event("doRestCommand() - about to add headers");
View Full Code Here

     * in building the outbound HTTP connection.
     *
     * @return the username/password auth. information to send with the request
     */
    protected AuthenticationInfo authenticationInfo() {
        return ((user != null || password != null) ? new AuthenticationInfo(user, password) : null);
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.admin.util.AuthenticationInfo

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.