Examples of AuthRealm


Examples of com.sun.enterprise.config.serverbeans.AuthRealm

            }
        }
        final SecurityService securityService = config.getSecurityService();

        // ensure we have the file authrealm
        AuthRealm fileAuthRealm = null;
       
        if (authRealmName == null)
            authRealmName = securityService.getDefaultRealm();       
       
        for (AuthRealm authRealm : securityService.getAuthRealm()) {           
            if (authRealm.getName().equals(authRealmName)) {
                fileAuthRealm = authRealm;           
                break;
            }
        }      
               
        if (fileAuthRealm == null) {
            report.setMessage(localStrings.getLocalString(
                "create.file.user.filerealmnotfound",
                "File realm {0} does not exist",
                authRealmName));
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            return;                                           
        }
       
        // Get FileRealm class name, match it with what is expected.
        String fileRealmClassName = fileAuthRealm.getClassname();

        // Report error if provided impl is not the one expected
        if (fileRealmClassName != null &&
            !fileRealmClassName.equals(
                "com.sun.enterprise.security.auth.realm.file.FileRealm")) {
            report.setMessage(
                localStrings.getLocalString(
                    "create.file.user.realmnotsupported",
                    "Configured file realm {0} is not supported.",
                    fileRealmClassName));
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            return;               
        }
        // ensure we have the file associated with the authrealm
        String keyFile = null;
        for (Property fileProp : fileAuthRealm.getProperty()) {
            if (fileProp.getName().equals("file"))
                keyFile = fileProp.getValue();
        }
        final String kf = keyFile;
        if (keyFile == null) {
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.AuthRealm

        try {
            ConfigSupport.apply(new SingleConfigCode<SecurityService>() {

                public Object run(SecurityService param)
                throws PropertyVetoException, TransactionFailure {
                AuthRealm newAuthRealm = param.createChild(AuthRealm.class);
                    populateAuthRealmElement(newAuthRealm);
                    param.getAuthRealm().add(newAuthRealm);
                    //In case of cluster instances, this is required to
                    //avoid issues with the listener's callback method
                    SecurityConfigListener.authRealmCreated(config, newAuthRealm);
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.AuthRealm

        // ensure we have the file authrealm
        if (authRealmName == null)
            authRealmName = securityService.getDefaultRealm();       

        AuthRealm fileAuthRealm = null;       
        for (AuthRealm authRealm : securityService.getAuthRealm()) {
            if (authRealm.getName().equals(authRealmName))                
                fileAuthRealm = authRealm;           
        }       
        if (fileAuthRealm == null) {
            report.setMessage(localStrings.getLocalString(
                "delete.file.user.filerealmnotfound",
                "File realm {0} does not exist", authRealmName));
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            return;                                           
        }
       
        // Get FileRealm class name, match it with what is expected.
        String fileRealmClassName = fileAuthRealm.getClassname();
       
        // Report error if provided impl is not the one expected
        if (fileRealmClassName != null &&
            !fileRealmClassName.equals(
                "com.sun.enterprise.security.auth.realm.file.FileRealm")) {
            report.setMessage(
                localStrings.getLocalString(
                    "delete.file.user.realmnotsupported",
                    "Configured file realm {0} is not supported.",
                    fileRealmClassName));
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            return;               
        }

        // ensure we have the file associated with the authrealm
        String keyFile = null;
        for (Property fileProp : fileAuthRealm.getProperty()) {
            if (fileProp.getName().equals("file"))
                keyFile = fileProp.getValue();
        }
        final String kFile = keyFile;
        if (keyFile == null) {
View Full Code Here

Examples of org.glassfish.admin.amx.intf.config.AuthRealm

        final DomainRoot domainRoot = getDomainRootProxy();
        final Domain domainConfig = domainRoot.child(Domain.class);
        final Map<String,Config> configs = domainConfig.getConfigs().childrenMap(Config.class);

        // find the ADMIN_REALM
        AuthRealm adminFileAuthRealm = null;
        for( final Config config : configs.values() )
        {
            if ( config.getSecurityService() == null ) continue;
           
            for( final AuthRealm auth : config.getSecurityService().childrenMap(AuthRealm.class).values() )
            {
                if ( auth.getName().equals(ADMIN_REALM) )
                {
                    adminFileAuthRealm = auth;
                    break;
                }
            }
        }
        if (adminFileAuthRealm == null) {
            // There must always be an admin realm
            throw new IllegalStateException( "Cannot find admin realm" );
        }

        // Get FileRealm class name
        final String fileRealmClassName = adminFileAuthRealm.getClassname();
        if (fileRealmClassName != null && ! fileRealmClassName.equals(FILE_REALM_CLASSNAME)) {
            // This condition can arise if admin-realm is not a File realm. Then the API to extract
            // the anonymous user should be integrated for the logic below this line of code. for now,
            // we treat this as an error and instead of throwing exception return false;
            return null;
        }

        final Map<String,Property>  props = adminFileAuthRealm.childrenMap(Property.class);
        final Property keyfileProp = props.get("file");
        if ( keyfileProp == null ) {
            throw new IllegalStateException( "Cannot find property 'file'" );
        }
        //System.out.println( "############### keyFileProp: " + keyfileProp.getName() + " = " + keyfileProp.getValue() );
        final String keyFile = keyfileProp.resolveAttribute( "Value" );
        //System.out.println( "############### keyFile: " + keyfileProp.getValue() + " ===> " + keyFile);
        if (keyFile == null) {
            throw new IllegalStateException( "Cannot find key file" );
        }
       
        //System.out.println( "############### keyFile: " + keyFile);
        String user = null;
        final String[] usernames = getUserNames(adminFileAuthRealm.getName());
        if (usernames.length == 1)
        {
            try
            {
                InjectedValues.getInstance().getHabitat().getByType(com.sun.enterprise.security.SecurityLifecycle.class);
View Full Code Here

Examples of org.glassfish.appclient.client.acc.config.AuthRealm

        return logger;
    }


    public AppClientContainerBuilder authRealm(final String className) {
        authRealm = new AuthRealm(className);
        return this;
    }
View Full Code Here

Examples of org.glassfish.appclient.client.acc.config.AuthRealm

        final List<MessageSecurityConfig> msc = clientContainer.getMessageSecurityConfig();
        if (msc != null) {
            builder.getMessageSecurityConfig().addAll(clientContainer.getMessageSecurityConfig());
        }
        builder.logger(new ACCLogger(clientContainer.getLogService()));
        final AuthRealm ar = clientContainer.getAuthRealm();
        if (ar != null) {
            builder.authRealm(ar.getClassname());
        }
        final List<Property> p = clientContainer.getProperty();
        if (p != null) {
            builder.containerProperties(p);
        }
View Full Code Here

Examples of org.glassfish.appclient.client.acc.config.AuthRealm

        final List<MessageSecurityConfig> msc = clientContainer.getMessageSecurityConfig();
        if (msc != null) {
            builder.getMessageSecurityConfig().addAll(clientContainer.getMessageSecurityConfig());
        }
        builder.logger(new ACCLogger(clientContainer.getLogService()));
        final AuthRealm ar = clientContainer.getAuthRealm();
        if (ar != null) {
            builder.authRealm(ar.getClassname());
        }
        final List<Property> p = clientContainer.getProperty();
        if (p != null) {
            builder.containerProperties(p);
        }
View Full Code Here

Examples of org.glassfish.appclient.client.acc.config.AuthRealm

        return logger;
    }


    public AppClientContainerBuilder authRealm(final String className) {
        authRealm = new AuthRealm(className);
        return this;
    }
View Full Code Here

Examples of org.glassfish.appclient.client.acc.config.AuthRealm

        return logger;
    }


    public AppClientContainerBuilder authRealm(final String className) {
        authRealm = new AuthRealm(className);
        return this;
    }
View Full Code Here

Examples of org.glassfish.appclient.client.acc.config.AuthRealm

        final List<MessageSecurityConfig> msc = clientContainer.getMessageSecurityConfig();
        if (msc != null) {
            builder.getMessageSecurityConfig().addAll(clientContainer.getMessageSecurityConfig());
        }
        builder.logger(new ACCLogger(clientContainer.getLogService()));
        final AuthRealm ar = clientContainer.getAuthRealm();
        if (ar != null) {
            builder.authRealm(ar.getClassname());
        }
        final List<Property> p = clientContainer.getProperty();
        if (p != null) {
            builder.containerProperties(p);
        }
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.