Package org.jboss.as.web.security

Examples of org.jboss.as.web.security.JBossWebRealm


                    roles.add(members.nextElement().getName());
            }
        }

        // if the subject didn't contain any roles, look for the roles declared in the deployment descriptor.
        JBossWebRealm realm = (JBossWebRealm) this.getContainer().getRealm();
        if (roles.isEmpty())
            roles.addAll(realm.getPrincipalVersusRolesMap().get(principal.getName()));

        // build and return the JBossGenericPrincipal.
        return new JBossGenericPrincipal(realm, principal.getName(), null, roles, principal, null, null, null, subject);

    }
View Full Code Here


                    roles.add(members.nextElement().getName());
            }
        }

        // if the subject didn't contain any roles, look for the roles declared in the deployment descriptor.
        JBossWebRealm realm = (JBossWebRealm) this.getContainer().getRealm();
        if (roles.isEmpty())
            roles.addAll(realm.getPrincipalVersusRolesMap().get(principal.getName()));

        // build and return the JBossGenericPrincipal.
        return new JBossGenericPrincipal(realm, principal.getName(), null, roles, principal, null, null, null, subject);

    }
View Full Code Here

      login.setAuthMethod(authMethod);
      login.setRealmName("ApplicationRealm");
      context.setLoginConfig(login);
      context.addSecurityRole("REST");

      JBossWebRealm realm = new JBossWebRealm();
      SecurityDomainContext securityDomainContext = securityDomainContextInjector.getValue();
      realm.setAuthenticationManager(securityDomainContext.getAuthenticationManager());
      realm.setAuthorizationManager(securityDomainContext.getAuthorizationManager());
      realm.setMappingManager(securityDomainContext.getMappingManager());
      realm.setAuditManager(securityDomainContext.getAuditManager());
      context.setRealm(realm);
      context.addValve(new RestSecurityContext(path, securityDomain));
      if ("SPNEGO".equals(authMethod)) {
         context.addValve(new NegotiationAuthenticator());
      }
View Full Code Here

                    roles.add(members.nextElement().getName());
            }
        }

        // if the subject didn't contain any roles, look for the roles declared in the deployment descriptor.
        JBossWebRealm realm = (JBossWebRealm) this.getContainer().getRealm();
        Set<String> descriptorRoles = realm.getPrincipalVersusRolesMap().get(principal.getName());
        if (roles.isEmpty() && descriptorRoles != null)
            roles.addAll(descriptorRoles);

        // build and return the JBossGenericPrincipal.
        return new JBossGenericPrincipal(realm, principal.getName(), null, roles, principal, null, null, null, subject);
View Full Code Here

        if (metaDataSecurityDomain != null) {
            metaDataSecurityDomain = metaDataSecurityDomain.trim();
        }

        // Get the realm details from the domain model
        JBossWebRealm realm = new JBossWebRealm();
        String securityDomain = metaDataSecurityDomain == null ? SecurityConstants.DEFAULT_APPLICATION_POLICY : SecurityUtil
                .unprefixSecurityDomain(metaDataSecurityDomain);

        // Set the current tccl and save it
        ClassLoader tcl = SecurityActions.getContextClassLoader();
        // Set the Module Class loader as the tccl such that the JNDI lookup of the JBoss Authentication/Authz managers succeed
        SecurityActions.setContextClassLoader(classLoader);

        try {
            AuthenticationManager authM = getAuthenticationManager(securityDomain);
            realm.setAuthenticationManager(authM);

            AuthorizationManager authzM = getAuthorizationManager(securityDomain);
            realm.setAuthorizationManager(authzM);

            webContext.setRealm(realm);
        } catch (NamingException e1) {
            throw new RuntimeException(e1);
        } finally {
View Full Code Here

        if (metaDataSecurityDomain != null) {
            metaDataSecurityDomain = metaDataSecurityDomain.trim();
        }

        // Get the realm details from the domain model
        JBossWebRealm realm = new JBossWebRealm();
        String securityDomain = metaDataSecurityDomain == null ? SecurityConstants.DEFAULT_APPLICATION_POLICY : SecurityUtil
                .unprefixSecurityDomain(metaDataSecurityDomain);

        // Set the current tccl and save it
        ClassLoader tcl = SecurityActions.getContextClassLoader();
        // Set the Module Class loader as the tccl such that the JNDI lookup of the JBoss Authentication/Authz managers succeed
        SecurityActions.setContextClassLoader(classLoader);

        try {
            AuthenticationManager authM = getAuthenticationManager(securityDomain);
            realm.setAuthenticationManager(authM);

            AuthorizationManager authzM = getAuthorizationManager(securityDomain);
            realm.setAuthorizationManager(authzM);

            webContext.setRealm(realm);
        } catch (NamingException e1) {
            throw new RuntimeException(e1);
        } finally {
View Full Code Here

            for (String group : gpc.getGroups())
                roles.add(group);
        }

        // look for the roles declared in the deployment descriptor.
        JBossWebRealm realm = (JBossWebRealm) this.getContainer().getRealm();
        Set<String> descriptorRoles = realm.getPrincipalVersusRolesMap().get(principal.getName());
        if (descriptorRoles != null)
            roles.addAll(descriptorRoles);

        // build and return the JBossGenericPrincipal.
        return new JBossGenericPrincipal(realm, principal.getName(), null, roles, principal, null, null, null, subject);
View Full Code Here

                    roles.add(members.nextElement().getName());
            }
        }

        // if the subject didn't contain any roles, look for the roles declared in the deployment descriptor.
        JBossWebRealm realm = (JBossWebRealm) this.getContainer().getRealm();
        if (roles.isEmpty())
            roles.addAll(realm.getPrincipalVersusRolesMap().get(principal.getName()));

        // build and return the JBossGenericPrincipal.
        return new JBossGenericPrincipal(realm, principal.getName(), null, roles, principal, null, null, null, subject);

    }
View Full Code Here

TOP

Related Classes of org.jboss.as.web.security.JBossWebRealm

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.