Package javax.security.auth.login

Examples of javax.security.auth.login.AppConfigurationEntry


            addConfiguration((ConfigurationEntryFactory) iter.next());
        }
    }

    public AppConfigurationEntry[] getAppConfigurationEntry(String name) {
        AppConfigurationEntry entry = (AppConfigurationEntry) entries.get(name);

        if (entry == null) return null;

        return new AppConfigurationEntry[]{entry};
    }
View Full Code Here


            throw new IllegalArgumentException("A login module to be registered standalone must have a domain name!");
        }
        if (entries.containsKey(factory.getConfigurationName())) {
            throw new java.lang.IllegalArgumentException("ConfigurationEntry already registered");
        }
        AppConfigurationEntry ace = new AppConfigurationEntry(config.getLoginModuleClassName(), config.getFlag().getFlag(), config.getOptions());

        entries.put(factory.getConfigurationName(), ace);
        log.info("Added Application Configuration Entry " + factory.getConfigurationName());
    }
View Full Code Here

            if (CONFIG_NAME.equals(applicationName) == false) {
                fail();
            }
            Map map = new HashMap();
            map.put("username", "password");
            AppConfigurationEntry entry = new AppConfigurationEntry(MockModule.class.getName(), AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, map);
            return new AppConfigurationEntry[] {entry};
        }
View Full Code Here

         buffer.append("No Entry\n");
      else
      {
         for (int c = 0; c < appEntry.length; c++)
         {
            AppConfigurationEntry entry = appEntry[c];
            buffer.append("LoginModule Class: " + entry.getLoginModuleName());
            buffer.append("\n<br>ControlFlag: " + entry.getControlFlag());
            buffer.append("\n<br>Options:<ul>");
            Map options = entry.getOptions();
            Iterator iter = options.entrySet().iterator();
            while (iter.hasNext())
            {
               Entry e = (Entry) iter.next();
               buffer.append("<li>");
View Full Code Here

    protected Configuration getConfiguration() {
        return new Configuration() {
            @Override
            public AppConfigurationEntry[] getAppConfigurationEntry(String s) {
                return new AppConfigurationEntry[]{
                        new AppConfigurationEntry(
                                LoginModuleImpl.class.getName(),
                                AppConfigurationEntry.LoginModuleControlFlag.SUFFICIENT,
                                Collections.<String, Object>emptyMap()),
                        new AppConfigurationEntry(
                                ExternalLoginModule.class.getName(),
                                AppConfigurationEntry.LoginModuleControlFlag.REQUIRED,
                                options)
                };
            }
View Full Code Here

    protected Configuration getConfiguration() {
        return new Configuration() {
            @Override
            public AppConfigurationEntry[] getAppConfigurationEntry(String s) {
                return new AppConfigurationEntry[]{
                        new AppConfigurationEntry(
                                ExternalLoginModule.class.getName(),
                                AppConfigurationEntry.LoginModuleControlFlag.REQUIRED,
                                options)
                };
            }
View Full Code Here

    protected Configuration getConfiguration() {
        return new Configuration() {
            @Override
            public AppConfigurationEntry[] getAppConfigurationEntry(String s) {
                AppConfigurationEntry entry = new AppConfigurationEntry(
                        ExternalLoginModule.class.getName(),
                        AppConfigurationEntry.LoginModuleControlFlag.REQUIRED,
                        options);
                return new AppConfigurationEntry[]{entry};
            }
View Full Code Here

     * @return
     * @throws Exception
     */
    protected Object doExecute() throws Exception {
        JaasRealm realm = (JaasRealm) session.get(JAAS_REALM);
        AppConfigurationEntry entry = (AppConfigurationEntry) session.get(JAAS_ENTRY);
        Queue commandQueue = (Queue) session.get(JAAS_CMDS);

        if (realm != null && entry != null) {
            if (commandQueue != null) {
                commandQueue.add(this);
View Full Code Here

     *
     * @param moduleName
     * @return
     */
    public AppConfigurationEntry findEntryByRealmAndName(JaasRealm realm, String moduleName) {
        AppConfigurationEntry appConfigurationEntry = null;
        if (realm != null) {

            AppConfigurationEntry[] entries = realm.getEntries();

            //If no moduleName provided and a there is a single module in the realm.
View Full Code Here

        if (realmName == null && index <= 0 ) {
            System.err.println("A valid realm or the realm index need to be specified");
            return null;
        }
        JaasRealm oldRealm = (JaasRealm) this.session.get(JAAS_REALM);
        AppConfigurationEntry oldEntry = (AppConfigurationEntry) this.session.get(JAAS_ENTRY);

        if (oldRealm != null && !oldRealm.getName().equals(realmName) && !force) {
            System.err.println("Another realm is being edited.  Cancel / update first, or use the --force option");
        } else if (oldEntry != null && !oldEntry.getLoginModuleName().equals(moduleName) && !force) {
            System.err.println("Another module is being edited.  Cancel / update first, or use the --force option");
        } else {

            JaasRealm realm = findRealmByNameOrIndex(realmName, index);

            if (realm != null) {
                AppConfigurationEntry entry = findEntryByRealmAndName(realm, moduleName);

                if (entry != null) {
                    Queue<JaasCommandSupport> commands = null;

                    commands = (Queue<JaasCommandSupport>) this.session.get(JAAS_CMDS);
View Full Code Here

TOP

Related Classes of javax.security.auth.login.AppConfigurationEntry

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.