Examples of JASPIAuthenticationInfo


Examples of org.jboss.security.auth.login.JASPIAuthenticationInfo

        }

        // authentication-jaspi
        node = operation.get(Element.AUTHENTICATION_JASPI.getLocalName());
        if (node.isDefined()) {
            JASPIAuthenticationInfo authenticationInfo = new JASPIAuthenticationInfo(securityDomain);
            Map<String, LoginModuleStackHolder> holders = new HashMap<String, LoginModuleStackHolder>();
            ModelNode moduleStack = node.get(Element.LOGIN_MODULE_STACK.getLocalName());
            modules = moduleStack.asList();
            Iterator<ModelNode> iter = modules.iterator();
            ModelNode nameNode = iter.next();
            String name = nameNode.get(Attribute.NAME.getLocalName()).asString();
            LoginModuleStackHolder holder = new LoginModuleStackHolder(name, null);
            holders.put(name, holder);
            authenticationInfo.add(holder);
            while (iter.hasNext()) {
                ModelNode module = iter.next();
                String code = module.require(Attribute.CODE.getLocalName()).asString();
                LoginModuleControlFlag controlFlag = getControlFlag(module.require(Attribute.FLAG.getLocalName()).asString());
                Map<String, Object> options = new HashMap<String, Object>();
                if (module.hasDefined(MODULE_OPTIONS)) {
                    for (Property prop : module.get(MODULE_OPTIONS).asPropertyList()) {
                        options.put(prop.getName(), prop.getValue().asString());
                    }
                }
                AppConfigurationEntry entry = new AppConfigurationEntry(code, controlFlag, options);
                holder.addAppConfigurationEntry(entry);
            }
            ModelNode authModule = node.get(Element.AUTH_MODULE.getLocalName());
            String code = authModule.require(Attribute.CODE.getLocalName()).asString();
            String loginStackRef = null;
            if (authModule.hasDefined(Attribute.LOGIN_MODULE_STACK_REF.getLocalName()))
                loginStackRef = authModule.get(Attribute.LOGIN_MODULE_STACK_REF.getLocalName()).asString();
            Map<String, Object> options = new HashMap<String, Object>();
            if (authModule.hasDefined(MODULE_OPTIONS)) {
                for (Property prop : authModule.get(MODULE_OPTIONS).asPropertyList()) {
                    options.put(prop.getName(), prop.getValue().asString());
                }
            }
            AuthModuleEntry entry = new AuthModuleEntry(code, options, loginStackRef);
            if (loginStackRef != null) {
                if (!holders.containsKey(loginStackRef)) {
                    throw new IllegalArgumentException("auth-module references a login module stack that doesn't exist: "
                            + loginStackRef);
                }
                entry.setLoginModuleStackHolder(holders.get(loginStackRef));
            }
            authenticationInfo.add(entry);
            applicationPolicy.setAuthenticationInfo(authenticationInfo);
        }

        return applicationPolicy;
    }
View Full Code Here

Examples of org.jboss.security.auth.login.JASPIAuthenticationInfo

        // authentication-jaspi
        node = operation.get(AUTHENTICATION_JASPI);
        if (node.isDefined()) {
            if (applicationPolicy == null)
                applicationPolicy = new ApplicationPolicy(securityDomain);
            JASPIAuthenticationInfo authenticationInfo = new JASPIAuthenticationInfo(securityDomain);
            Map<String, LoginModuleStackHolder> holders = new HashMap<String, LoginModuleStackHolder>();
            ModelNode moduleStack = node.get(LOGIN_MODULE_STACK);
            modules = moduleStack.asList();
            for (ModelNode loginModuleStack : modules) {
                List<ModelNode> nodes = loginModuleStack.asList();
                Iterator<ModelNode> iter = nodes.iterator();
                ModelNode nameNode = iter.next();
                String name = nameNode.get(NAME).asString();
                LoginModuleStackHolder holder = new LoginModuleStackHolder(name, null);
                holders.put(name, holder);
                authenticationInfo.add(holder);
                while (iter.hasNext()) {
                    ModelNode lmsNode = iter.next();
                    List<ModelNode> lms = lmsNode.asList();
                    for (ModelNode lmNode : lms) {
                        String code = lmNode.require(CODE).asString();
                        LoginModuleControlFlag controlFlag = getControlFlag(lmNode.require(FLAG).asString());
                        Map<String, Object> options = new HashMap<String, Object>();
                        if (lmNode.hasDefined(MODULE_OPTIONS)) {
                            for (Property prop : lmNode.get(MODULE_OPTIONS).asPropertyList()) {
                                options.put(prop.getName(), prop.getValue().asString());
                            }
                        }
                        AppConfigurationEntry entry = new AppConfigurationEntry(code, controlFlag, options);
                        holder.addAppConfigurationEntry(entry);
                    }
                }
            }
            ModelNode authModuleNode = node.get(AUTH_MODULE);
            List<ModelNode> authModules = authModuleNode.asList();
            for (ModelNode authModule : authModules) {
                String code = authModule.require(CODE).asString();
                String loginStackRef = null;
                if (authModule.hasDefined(LOGIN_MODULE_STACK_REF))
                    loginStackRef = authModule.get(LOGIN_MODULE_STACK_REF).asString();
                Map<String, Object> options = new HashMap<String, Object>();
                if (authModule.hasDefined(MODULE_OPTIONS)) {
                    for (Property prop : authModule.get(MODULE_OPTIONS).asPropertyList()) {
                        options.put(prop.getName(), prop.getValue().asString());
                    }
                }
                AuthModuleEntry entry = new AuthModuleEntry(code, options, loginStackRef);
                if (loginStackRef != null) {
                    if (!holders.containsKey(loginStackRef)) {
                        throw new IllegalArgumentException("auth-module references a login module stack that doesn't exist: "
                                + loginStackRef);
                    }
                    entry.setLoginModuleStackHolder(holders.get(loginStackRef));
                }
                authenticationInfo.add(entry);
            }
            applicationPolicy.setAuthenticationInfo(authenticationInfo);
        }

        return applicationPolicy;
View Full Code Here

Examples of org.jboss.security.auth.login.JASPIAuthenticationInfo

        }

        // authentication-jaspi
        node = operation.get(Element.AUTHENTICATION_JASPI.getLocalName());
        if (node.isDefined()) {
            JASPIAuthenticationInfo authenticationInfo = new JASPIAuthenticationInfo(securityDomain);
            Map<String, LoginModuleStackHolder> holders = new HashMap<String, LoginModuleStackHolder>();
            ModelNode moduleStack = node.get(Element.LOGIN_MODULE_STACK.getLocalName());
            modules = moduleStack.asList();
            for (ModelNode loginModuleStack : modules) {
                List<ModelNode> nodes = loginModuleStack.asList();
                Iterator<ModelNode> iter = nodes.iterator();
                ModelNode nameNode = iter.next();
                String name = nameNode.get(Attribute.NAME.getLocalName()).asString();
                LoginModuleStackHolder holder = new LoginModuleStackHolder(name, null);
                holders.put(name, holder);
                authenticationInfo.add(holder);
                while (iter.hasNext()) {
                    ModelNode lmsNode = iter.next();
                    List<ModelNode> lms = lmsNode.asList();
                    for (ModelNode lmNode : lms) {
                        String code = lmNode.require(Attribute.CODE.getLocalName()).asString();
                        LoginModuleControlFlag controlFlag = getControlFlag(lmNode.require(Attribute.FLAG.getLocalName())
                                .asString());
                        Map<String, Object> options = new HashMap<String, Object>();
                        if (lmNode.hasDefined(MODULE_OPTIONS)) {
                            for (Property prop : lmNode.get(MODULE_OPTIONS).asPropertyList()) {
                                options.put(prop.getName(), prop.getValue().asString());
                            }
                        }
                        AppConfigurationEntry entry = new AppConfigurationEntry(code, controlFlag, options);
                        holder.addAppConfigurationEntry(entry);
                    }
                }
            }
            ModelNode authModuleNode = node.get(Element.AUTH_MODULE.getLocalName());
            List<ModelNode> authModules = authModuleNode.asList();
            for (ModelNode authModule : authModules) {
                String code = authModule.require(Attribute.CODE.getLocalName()).asString();
                String loginStackRef = null;
                if (authModule.hasDefined(Attribute.LOGIN_MODULE_STACK_REF.getLocalName()))
                    loginStackRef = authModule.get(Attribute.LOGIN_MODULE_STACK_REF.getLocalName()).asString();
                Map<String, Object> options = new HashMap<String, Object>();
                if (authModule.hasDefined(MODULE_OPTIONS)) {
                    for (Property prop : authModule.get(MODULE_OPTIONS).asPropertyList()) {
                        options.put(prop.getName(), prop.getValue().asString());
                    }
                }
                AuthModuleEntry entry = new AuthModuleEntry(code, options, loginStackRef);
                if (loginStackRef != null) {
                    if (!holders.containsKey(loginStackRef)) {
                        throw new IllegalArgumentException("auth-module references a login module stack that doesn't exist: "
                                + loginStackRef);
                    }
                    entry.setLoginModuleStackHolder(holders.get(loginStackRef));
                }
                authenticationInfo.add(entry);
            }
            applicationPolicy.setAuthenticationInfo(authenticationInfo);
        }

        return applicationPolicy;
View Full Code Here

Examples of org.jboss.security.auth.login.JASPIAuthenticationInfo

         binfo.add(authenticationModuleEntries);
         info.setAuthenticationInfo(binfo);
      }
      if(isJASPIAuthentication)
      {
         binfo = new JASPIAuthenticationInfo(authName);
         binfo.add(authenticationModuleEntries);
         info.setAuthenticationInfo(binfo);
      }
      if(isAuthorization)
      {
View Full Code Here

Examples of org.jboss.security.auth.login.JASPIAuthenticationInfo

/* 189 */       SecurityActions.addModules(binfo, this.authenticationModuleEntries);
/* 190 */       this.info.setAuthenticationInfo(binfo);
/*     */     }
/* 192 */     if (this.isJASPIAuthentication)
/*     */     {
/* 194 */       binfo = new JASPIAuthenticationInfo(this.authName);
/* 195 */       SecurityActions.addModules(binfo, this.authenticationModuleEntries);
/* 196 */       this.info.setAuthenticationInfo(binfo);
/*     */     }
/* 198 */     if (this.isAuthorization)
/*     */     {
View Full Code Here

Examples of org.jboss.security.auth.login.JASPIAuthenticationInfo

/* 116 */       sam.initialize(null, null, new SecurityAssociationHandler(), options);
/* 117 */       this.modules.add(sam);
/*     */     }
/*     */     else
/*     */     {
/* 121 */       JASPIAuthenticationInfo jai = (JASPIAuthenticationInfo)bai;
/* 122 */       AuthModuleEntry[] amearr = jai.getAuthModuleEntry();
/* 123 */       for (AuthModuleEntry ame : amearr)
/*     */       {
/* 125 */         if (ame.getLoginModuleStackHolderName() != null)
/*     */         {
/*     */           try
View Full Code Here

Examples of org.jboss.security.auth.login.JASPIAuthenticationInfo

         sam.initialize(null, null, this.callbackHandler, options);
         modules.add(sam);
      }
      else
      {
         JASPIAuthenticationInfo jai = (JASPIAuthenticationInfo)bai;
         AuthModuleEntry[] amearr = jai.getAuthModuleEntry();
         for(AuthModuleEntry ame: amearr)
         {
            if(ame.getLoginModuleStackHolderName() != null)
            {
               try
View Full Code Here

Examples of org.jboss.security.auth.login.JASPIAuthenticationInfo

         SecurityActions.addModules(binfo, authenticationModuleEntries);
         info.setAuthenticationInfo(binfo);
      }
      if (isJASPIAuthentication)
      {
         JASPIAuthenticationInfo jaspiInfo = new JASPIAuthenticationInfo(authName);
         SecurityActions.addModules(jaspiInfo, authenticationModuleEntries);
         for (LoginModuleStackHolder holder : this.loginModuleStackMap.values())
            jaspiInfo.add(holder);
         info.setAuthenticationInfo(jaspiInfo);
      }
      if (isAuthorization)
      {
         ainfo = new AuthorizationInfo(authName);
View Full Code Here

Examples of org.jboss.security.auth.login.JASPIAuthenticationInfo

    private boolean processJASPIAuth(String securityDomain, ModelNode node, ApplicationPolicy applicationPolicy) {
        node = peek(node, AUTHENTICATION, JASPI);
        if (node == null)
            return false;

        JASPIAuthenticationInfo authenticationInfo = new JASPIAuthenticationInfo(securityDomain);
        Map<String, LoginModuleStackHolder> holders = new HashMap<String, LoginModuleStackHolder>();
        List <ModelNode> stacks = node.get(LOGIN_MODULE_STACK).asList();
        for (ModelNode stack : stacks) {
            String name = stack.require(NAME).asString();
            List<ModelNode> nodes = stack.get(LOGIN_MODULES).asList();

            final LoginModuleStackHolder holder = new LoginModuleStackHolder(name, null);
            holders.put(name, holder);
            authenticationInfo.add(holder);
            for (ModelNode login : nodes) {
                processLoginModules(login, new LoginModuleContainer() {
                    public void addAppConfigurationEntry(AppConfigurationEntry entry) {
                        holder.addAppConfigurationEntry(entry);
                    }
                });
            }
        }
        List<ModelNode> authModules = node.get(AUTH_MODULES).asList();
        for (ModelNode authModule : authModules) {
            String code = extractCode(authModule, ModulesMap.AUTHENTICATION_MAP);
            String loginStackRef = null;
            if (authModule.hasDefined(LOGIN_MODULE_STACK_REF))
                loginStackRef = authModule.get(LOGIN_MODULE_STACK_REF).asString();
            Map<String, Object> options = extractOptions(authModule) ;
            AuthModuleEntry entry = new AuthModuleEntry(code, options, loginStackRef);
            if (loginStackRef != null) {
                if (!holders.containsKey(loginStackRef)) {
                    throw new IllegalArgumentException("auth-module references a login module stack that doesn't exist: "
                            + loginStackRef);
                }
                entry.setLoginModuleStackHolder(holders.get(loginStackRef));
            }
            authenticationInfo.add(entry);
        }
        applicationPolicy.setAuthenticationInfo(authenticationInfo);
        return true;
    }
View Full Code Here

Examples of org.jboss.security.auth.login.JASPIAuthenticationInfo

    private boolean processJASPIAuth(String securityDomain, ModelNode node, ApplicationPolicy applicationPolicy) {
        node = peek(node, AUTHENTICATION, JASPI);
        if (node == null)
            return false;

        JASPIAuthenticationInfo authenticationInfo = new JASPIAuthenticationInfo(securityDomain);
        Map<String, LoginModuleStackHolder> holders = new HashMap<String, LoginModuleStackHolder>();
        List<Property> stacks = node.get(LOGIN_MODULE_STACK).asPropertyList();
        for (Property stack : stacks) {
            String name = stack.getName();
            List<ModelNode> nodes = stack.getValue().get(LOGIN_MODULES).asList();

            final LoginModuleStackHolder holder = new LoginModuleStackHolder(name, null);
            holders.put(name, holder);
            authenticationInfo.add(holder);
            for (ModelNode login : nodes) {
                processLoginModules(login, authenticationInfo, new LoginModuleContainer() {
                    public void addAppConfigurationEntry(AppConfigurationEntry entry) {
                        holder.addAppConfigurationEntry(entry);
                    }
                });
            }
        }
        List<ModelNode> authModules = node.get(AUTH_MODULES).asList();
        for (ModelNode authModule : authModules) {
            String code = extractCode(authModule, ModulesMap.AUTHENTICATION_MAP);
            String loginStackRef = null;
            if (authModule.hasDefined(LOGIN_MODULE_STACK_REF))
                loginStackRef = authModule.get(LOGIN_MODULE_STACK_REF).asString();
            Map<String, Object> options = extractOptions(authModule) ;
            AuthModuleEntry entry = new AuthModuleEntry(code, options, loginStackRef);
            if (loginStackRef != null) {
                if (!holders.containsKey(loginStackRef)) {
                    throw new IllegalArgumentException("auth-module references a login module stack that doesn't exist: "
                            + loginStackRef);
                }
                entry.setLoginModuleStackHolder(holders.get(loginStackRef));
            }
            authenticationInfo.add(entry);
        }
        applicationPolicy.setAuthenticationInfo(authenticationInfo);
        return true;
    }
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.