Package javax.security.auth.login

Examples of javax.security.auth.login.AppConfigurationEntry


  public static Configuration makeConfiguration() {
    return new Configuration() {
      @Override
      public AppConfigurationEntry[] getAppConfigurationEntry(String name) {
        if (name.equals("Wave")) {
          AppConfigurationEntry entry =
              new AppConfigurationEntry(AccountStoreLoginModule.class.getName(),
                  LoginModuleControlFlag.REQUIRED, new HashMap<String, Object>());

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


            options.put(SERVERINFO_LM_OPTION, serverInfo);
        }
        if (!options.containsKey(CLASSLOADER_LM_OPTION)) {
            options.put(CLASSLOADER_LM_OPTION, bundle);
        }
        AppConfigurationEntry entry;
        if (loginModule.isWrapPrincipals()) {
            Class loginModuleClass = bundle.loadClass(loginModule.getLoginModuleClass());
            options.put(WrappingLoginModule.CLASS_OPTION, loginModuleClass);
            options.put(WrappingLoginModule.DOMAIN_OPTION, loginModule.getLoginDomainName());
            options.put(WrappingLoginModule.REALM_OPTION, realmName);
            options.put(ProxyLoginModule.PROPERTY_MODULE, WrappingLoginModule.class.getName());
        } else {
            options.put(ProxyLoginModule.PROPERTY_MODULE, loginModule.getLoginModuleClass());
        }
        options.put(ProxyLoginModule.PROPERTY_BUNDLE, Long.toString(bundle.getBundleId()));
        entry = new AppConfigurationEntry(ProxyLoginModule.class.getName(), controlFlag.getFlag(), options);
        if (loginModule.getLoginDomainName() != null) {
            if (domainNames.contains(loginModule.getLoginDomainName())) {
                throw new IllegalStateException("Error in realm: one security realm cannot contain multiple login modules for the same login domain");
            } else {
                domainNames.add(loginModule.getLoginDomainName());
View Full Code Here

public class FlagsMeaningTest extends TestCase {
    private static final Map<String, Object> noOptions = Collections.emptyMap();

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

        lc.login();
    }

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

        lc.login();
    }

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

        lc.login();
    }

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

        lc.login();
    }

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

        lc.login();
    }

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

        }
    }

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

        }
    }

    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 {
            lc.login();
            fail("login exception expected");
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.