Package javax.security.auth.login

Examples of javax.security.auth.login.Configuration


        } catch (LoginException e) {
        }
    }

    public void testRequisiteTrueException() throws LoginException {
        Configuration conf = new FixedConfiguration(new AppConfigurationEntry[] {
                new AppConfigurationEntry(TrueLM.class.getName(), AppConfigurationEntry.LoginModuleControlFlag.REQUISITE, noOptions),
                new AppConfigurationEntry(ExceptionLM.class.getName(), AppConfigurationEntry.LoginModuleControlFlag.REQUISITE, noOptions),
        });
        LoginContext lc = new LoginContext("foo", null, null, conf);
        try {
View Full Code Here


        } catch (LoginException e) {
        }
    }

    public void testRequiredTrueException() throws LoginException {
        Configuration conf = new FixedConfiguration(new AppConfigurationEntry[] {
                new AppConfigurationEntry(TrueLM.class.getName(), AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, noOptions),
                new AppConfigurationEntry(ExceptionLM.class.getName(), AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, noOptions),
        });
        LoginContext lc = new LoginContext("foo", null, null, conf);
        try {
View Full Code Here

        } catch (LoginException e) {
        }
    }

    public void testRequiredTrueFalse() throws LoginException {
        Configuration conf = new FixedConfiguration(new AppConfigurationEntry[] {
                new AppConfigurationEntry(TrueLM.class.getName(), AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, noOptions),
                new AppConfigurationEntry(FalseLM.class.getName(), AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, noOptions),
        });
        LoginContext lc = new LoginContext("foo", null, null, conf);
        lc.login();
View Full Code Here

        LoginContext lc = new LoginContext("foo", null, null, conf);
        lc.login();
    }

    public void testRequiredFalseTrue() throws LoginException {
        Configuration conf = new FixedConfiguration(new AppConfigurationEntry[] {
                new AppConfigurationEntry(FalseLM.class.getName(), AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, noOptions),
                new AppConfigurationEntry(TrueLM.class.getName(), AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, noOptions),
        });
        LoginContext lc = new LoginContext("foo", null, null, conf);
        lc.login();
View Full Code Here

        LoginContext lc = new LoginContext("foo", null, null, conf);
        lc.login();
    }

    public void testRequisiteTrueFalse() throws LoginException {
        Configuration conf = new FixedConfiguration(new AppConfigurationEntry[] {
                new AppConfigurationEntry(TrueLM.class.getName(), AppConfigurationEntry.LoginModuleControlFlag.REQUISITE, noOptions),
                new AppConfigurationEntry(FalseLM.class.getName(), AppConfigurationEntry.LoginModuleControlFlag.REQUISITE, noOptions),
        });
        LoginContext lc = new LoginContext("foo", null, null, conf);
        lc.login();
View Full Code Here

        LoginContext lc = new LoginContext("foo", null, null, conf);
        lc.login();
    }
   
    public void testRequisiteFalseTrue() throws LoginException {
        Configuration conf = new FixedConfiguration(new AppConfigurationEntry[] {
                new AppConfigurationEntry(FalseLM.class.getName(), AppConfigurationEntry.LoginModuleControlFlag.REQUISITE, noOptions),
                new AppConfigurationEntry(TrueLM.class.getName(), AppConfigurationEntry.LoginModuleControlFlag.REQUISITE, noOptions),
        });
        LoginContext lc = new LoginContext("foo", null, null, conf);
        lc.login();
View Full Code Here

        try {
            oldConfiguration = Configuration.getConfiguration();
        } catch (SecurityException e) {
            oldConfiguration = null;
        }
        Configuration loginConfig = new MockConfiguration();
        Configuration.setConfiguration(loginConfig);

        authenticator = new Authenticator(CONFIG_NAME, getClass().getClassLoader());
    }
View Full Code Here

                            SecurityManagementService.SERVICE_NAME, ISecurityManagement.class,
                            subjectFactoryService.getSecurityManagementInjector())
                            .setInitialMode(ServiceController.Mode.ACTIVE).install();

                    // add jaas configuration service
                    Configuration loginConfig = XMLLoginConfigImpl.getInstance();
                    final JaasConfigurationService jaasConfigurationService = new JaasConfigurationService(loginConfig);
                    target.addService(JaasConfigurationService.SERVICE_NAME, jaasConfigurationService).setInitialMode(
                            ServiceController.Mode.ACTIVE).install();

                    resultHandler.handleResultComplete();
View Full Code Here

         params={@ManagementParameter(name="objectName", description="The identifier of the MBean that contains the Configuration")},
         impact = Impact.WriteOnly)
   public synchronized void pushLoginConfig(String objectName) throws JMException, MalformedObjectNameException
   {
      ObjectName name = new ObjectName(objectName);
      Configuration prevConfig = null;
      if (!this.loginConfigStack.empty())
         prevConfig = this.loginConfigStack.peek();

      this.loginConfigStack.push(installConfig(name, prevConfig));
   }
View Full Code Here

    */
   private Configuration installConfig(ObjectName name, Configuration prevConfig) throws JMException
   {
      Object[] args = {prevConfig};
      String[] signature = {"javax.security.auth.login.Configuration"};
      Configuration config = (Configuration) this.getMbeanServer().invoke(name, "getConfiguration", args, signature);
      Configuration.setConfiguration(config);
      log.debug("Installed JAAS Configuration service=" + name + ", config=" + config);
      return config;
   }
View Full Code Here

TOP

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

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.