Package org.glassfish.internal.api

Examples of org.glassfish.internal.api.AdminAccessController


    public boolean authenticate(Request req)
            throws Exception {
        String[] up = AdminAdapter.getUserPassword(req);
        String user = up[0];
        String password = up.length > 1 ? up[1] : "";
        AdminAccessController authenticator = habitat.getByContract(AdminAccessController.class);
        if (authenticator != null) {
            return authenticator.loginAsAdmin(user, password, as.getAuthRealmName());
        }
        return true;   //if the authenticator is not available, allow all access - per Jerome
    }
View Full Code Here


     *
     * @return subject identifying the user/client
     */
    public static Subject authenticateViaAdminRealm(ServiceLocator habitat, Request req, String remoteHost) throws LoginException, IOException {
        Subject subject = null;
        final AdminAccessController authenticator = habitat.getService(AdminAccessController.class);
        if (authenticator != null) {
            // This is temporary workaround for a Grizzly issue that prohibits uploading (deploy)  files larger than 2MB when secure admin is enabled.
            // The workaround will not be required in trunk when the corresponding Grizzly issue is fixed.
            // Please see http://java.net/jira/browse/GLASSFISH-16665 for details
            // The workaround duplicates code from AdminAdapter.

            subject = authenticator.loginAsAdmin(req, remoteHost);
        }
        return subject;
    }
View Full Code Here

     */
    public static  AdminAccessController.Access authenticateViaAdminRealm(Habitat habitat, GrizzlyRequest req, String remoteHost) throws IOException, LoginException {
        String[] up = AdminAdapter.getUserPassword(req.getRequest());
        String user = up[0];
        String password = up.length > 1 ? up[1] : "";
        AdminAccessController authenticator = habitat.getByContract(AdminAccessController.class);
        AdminAccessController.Access access = AdminAccessController.Access.FULL; //if the authenticator is not available, allow all access - per Jerome
        if (authenticator != null) {
            // This is temporary workaround for a Grizzly issue that prohibits uploading (deploy)  files larger than 2MB when secure admin is enabled.
            // The workaround will not be required in trunk when the corresponding Grizzly issue is fixed.
            // Please see http://java.net/jira/browse/GLASSFISH-16665 for details
            // The workaround duplicates code from AdminAdapter.
            ServerEnvironment serverEnvironment = habitat.getByContract(ServerEnvironment.class);
            final Principal sslPrincipal = !serverEnvironment.isDas() || Boolean.getBoolean(DAS_LOOK_FOR_CERT_PROPERTY_NAME) ? req.getUserPrincipal() : null;

            AdminService as = habitat.getByType(AdminService.class);
            access =  authenticator.loginAsAdmin(user, password, as.getAuthRealmName(), remoteHost, getAuthRelatedHeaders(req), sslPrincipal);
        }
        return access;
    }
View Full Code Here

     *
     * @return subject identifying the user/client
     */
    public static Subject authenticateViaAdminRealm(ServiceLocator habitat, Request req, String remoteHost) throws LoginException, IOException {
        Subject subject = null;
        final AdminAccessController authenticator = habitat.getService(AdminAccessController.class);
        if (authenticator != null) {
            // This is temporary workaround for a Grizzly issue that prohibits uploading (deploy)  files larger than 2MB when secure admin is enabled.
            // The workaround will not be required in trunk when the corresponding Grizzly issue is fixed.
            // Please see http://java.net/jira/browse/GLASSFISH-16665 for details
            // The workaround duplicates code from AdminAdapter.

            subject = authenticator.loginAsAdmin(req, remoteHost);
        }
        return subject;
    }
View Full Code Here

     *
     * @return subject identifying the user/client
     */
    public static Subject authenticateViaAdminRealm(ServiceLocator habitat, Request req, String remoteHost) throws LoginException, IOException {
        Subject subject = null;
        final AdminAccessController authenticator = habitat.getService(AdminAccessController.class);
        if (authenticator != null) {
            // This is temporary workaround for a Grizzly issue that prohibits uploading (deploy)  files larger than 2MB when secure admin is enabled.
            // The workaround will not be required in trunk when the corresponding Grizzly issue is fixed.
            // Please see http://java.net/jira/browse/GLASSFISH-16665 for details
            // The workaround duplicates code from AdminAdapter.

            subject = authenticator.loginAsAdmin(req, remoteHost);
        }
        return subject;
    }
View Full Code Here

     * @param subject
     * @param remoteHost
     * @return
     */
    public static AdminAccessController.Access chooseAccess(final ServiceLocator habitat, final Subject subject, final String remoteHost) {
        final AdminAccessController authenticator = habitat.getService(AdminAccessController.class);
        final AdminAccessController.Access access = authenticator.chooseAccess(subject, remoteHost);
        return access;
        }
View Full Code Here

     *
     * @return subject identifying the user/client
     */
    public static Subject authenticateViaAdminRealm(ServiceLocator habitat, Request req, String remoteHost) throws LoginException, IOException {
        Subject subject = null;
        final AdminAccessController authenticator = habitat.getService(AdminAccessController.class);
        if (authenticator != null) {
            // This is temporary workaround for a Grizzly issue that prohibits uploading (deploy)  files larger than 2MB when secure admin is enabled.
            // The workaround will not be required in trunk when the corresponding Grizzly issue is fixed.
            // Please see http://java.net/jira/browse/GLASSFISH-16665 for details
            // The workaround duplicates code from AdminAdapter.

            subject = authenticator.loginAsAdmin(req, remoteHost);
        }
        return subject;
    }
View Full Code Here

     *
     * @return subject identifying the user/client
     */
    public static Subject authenticateViaAdminRealm(ServiceLocator habitat, Request req, String remoteHost) throws LoginException, IOException {
        Subject subject = null;
        final AdminAccessController authenticator = habitat.getService(AdminAccessController.class);
        if (authenticator != null) {
            // This is temporary workaround for a Grizzly issue that prohibits uploading (deploy)  files larger than 2MB when secure admin is enabled.
            // The workaround will not be required in trunk when the corresponding Grizzly issue is fixed.
            // Please see http://java.net/jira/browse/GLASSFISH-16665 for details
            // The workaround duplicates code from AdminAdapter.

            subject = authenticator.loginAsAdmin(req, remoteHost);
        }
        return subject;
    }
View Full Code Here

     * @param subject
     * @param remoteHost
     * @return
     */
    public static AdminAccessController.Access chooseAccess(final ServiceLocator habitat, final Subject subject, final String remoteHost) {
        final AdminAccessController authenticator = habitat.getService(AdminAccessController.class);
        final AdminAccessController.Access access = authenticator.chooseAccess(subject, remoteHost);
        return access;
        }
View Full Code Here

     *
     * @return subject identifying the user/client
     */
    public static Subject authenticateViaAdminRealm(ServiceLocator habitat, Request req, String remoteHost) throws LoginException, IOException {
        Subject subject = null;
        final AdminAccessController authenticator = habitat.getService(AdminAccessController.class);
        if (authenticator != null) {
            // This is temporary workaround for a Grizzly issue that prohibits uploading (deploy)  files larger than 2MB when secure admin is enabled.
            // The workaround will not be required in trunk when the corresponding Grizzly issue is fixed.
            // Please see http://java.net/jira/browse/GLASSFISH-16665 for details
            // The workaround duplicates code from AdminAdapter.

            subject = authenticator.loginAsAdmin(req, remoteHost);
        }
        return subject;
    }
View Full Code Here

TOP

Related Classes of org.glassfish.internal.api.AdminAccessController

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.