Package org.apache.geronimo.security.deploy

Examples of org.apache.geronimo.security.deploy.SubjectInfo


        if (defaultSubject == null) {
            return null;
        }
        String realmName = defaultSubject.getRealm().trim();
        String id = defaultSubject.getId().trim();
        return new SubjectInfo(realmName, id);
    }
View Full Code Here


            for (int i = 0; i < roleMappingsType.sizeOfRoleArray(); i++) {
                GerRoleType roleType = roleMappingsType.getRoleArray(i);

                String roleName = roleType.getRoleName().trim();
                if (roleType.isSetRunAsSubject()) {
                    SubjectInfo subjectInfo = buildSubjectInfo(roleType.getRunAsSubject());
                    roleDesignates.put(roleName, subjectInfo);
                }

                for (int j = 0; j < roleType.sizeOfRealmPrincipalArray(); j++) {
                    Principal principal = buildRealmPrincipal(roleType.getRealmPrincipalArray(j), classLoader);
                    add(roleName, principal, principalRoleMap);
                }

                for (int j = 0; j < roleType.sizeOfLoginDomainPrincipalArray(); j++) {
                    Principal principal = buildDomainPrincipal(roleType.getLoginDomainPrincipalArray(j), classLoader);
                    add(roleName, principal, principalRoleMap);
                }

                for (int j = 0; j < roleType.sizeOfPrincipalArray(); j++) {
                    Principal principal = buildPrincipal(roleType.getPrincipalArray(j), classLoader);
                    add(roleName, principal, principalRoleMap);
                }

            }
        }

        SubjectInfo defaultSubjectInfo = buildSubjectInfo(securityType.getDefaultSubject());
        AbstractNameQuery credentialStoreName;
        if (securityType.isSetCredentialStoreRef()) {
            PatternType credentialStoreType = securityType.getCredentialStoreRef();
            credentialStoreName = SingleGBeanBuilder.buildAbstractNameQuery(credentialStoreType, GBeanInfoBuilder.DEFAULT_J2EE_TYPE, Collections.singleton(CredentialStore.class.getName()));
        } else {
View Full Code Here

    public void testExplicitMapping() throws Exception {
        if (1 == 1) return;

        String securityRealmName = "demo-properties-realm";
        String defaultPrincipalId = "izumi";
        SubjectInfo defaultSubjectInfo = new SubjectInfo(securityRealmName, defaultPrincipalId);

        Map<String, SubjectInfo> roleDesignates = Collections.emptyMap();
        Map<Principal, Set<String>> principalRoleMap = Collections.singletonMap((Principal)new GeronimoGroupPrincipal("it"), Collections.singleton("content-administrator"));

        PermissionCollection uncheckedPermissions = new Permissions();
View Full Code Here

     */
    public void testExplicitMapping() throws Exception {

        String securityRealmName = "demo-properties-realm";
        String defaultPrincipalId = "izumi";
        SubjectInfo defaultSubjectInfo = new SubjectInfo(securityRealmName, defaultPrincipalId);

        Map<String, SubjectInfo> roleDesignates = Collections.emptyMap();
        Map<Principal, Set<String>> principalRoleMap = Collections.singletonMap((Principal)new GeronimoGroupPrincipal("it"), Collections.singleton("content-administrator"));

        PermissionCollection uncheckedPermissions = new Permissions();
View Full Code Here

     * @throws Exception thrown if an error in the test occurs
     */
    public void testExplicitMapping() throws Exception {
        String securityRealmName = "demo-properties-realm";
        String defaultPrincipalId = "izumi";
        SubjectInfo defaultSubjectInfo = new SubjectInfo(securityRealmName, defaultPrincipalId);

        Map<String, SubjectInfo> roleDesignates = Collections.emptyMap();
        Map<Principal, Set<String>> principalRoleMap = Collections.singletonMap((Principal)new GeronimoGroupPrincipal("it"), Collections.singleton("content-administrator"));

        PermissionCollection uncheckedPermissions = new Permissions();
View Full Code Here

                    if (realmName != null) {
                        appClientContainerGBeanData.setAttribute("realmName", realmName);
                        appClientContainerGBeanData.setAttribute("callbackHandlerClassName", callbackHandlerClassName);
                    } else if (geronimoAppClient.isSetDefaultSubject()) {
                        GerSubjectInfoType subjectInfoType = geronimoAppClient.getDefaultSubject();
                        SubjectInfo subjectInfo = buildSubjectInfo(subjectInfoType);
                        appClientContainerGBeanData.setAttribute("defaultSubject", subjectInfo);
                        appClientContainerGBeanData.setReferencePattern("CredentialStore", credentialStoreName);
                    } else if (earContext.getSecurityConfiguration() != null) {
                        log.warn("Configuration of app client default subject from ear security configuration no longer supported.");
                        //beware a linkage error if we cast this to SubjectInfo
View Full Code Here

    }

    private SubjectInfo buildSubjectInfo(GerSubjectInfoType defaultSubject) {
        String realmName = defaultSubject.getRealm().trim();
        String id = defaultSubject.getId().trim();
        return new SubjectInfo(realmName, id);
    }
View Full Code Here

    public void testExplicitMapping() throws Exception {
        if (1 == 1) return;

        String securityRealmName = "demo-properties-realm";
        String defaultPrincipalId = "izumi";
        SubjectInfo defaultSubjectInfo = new SubjectInfo(securityRealmName, defaultPrincipalId);

        Map<String, SubjectInfo> roleDesignates = Collections.emptyMap();
        Map<Principal, Set<String>> principalRoleMap = Collections.singletonMap((Principal)new GeronimoGroupPrincipal("it"), Collections.singleton("content-administrator"));

        PermissionCollection uncheckedPermissions = new Permissions();
View Full Code Here

        if (defaultSubject == null) {
            return null;
        }
        String realmName = defaultSubject.getRealm().trim();
        String id = defaultSubject.getId().trim();
        return new SubjectInfo(realmName, id);
    }
View Full Code Here

            for (int i = 0; i < roleMappingsType.sizeOfRoleArray(); i++) {
                GerRoleType roleType = roleMappingsType.getRoleArray(i);

                String roleName = roleType.getRoleName().trim();
                if (roleType.isSetRunAsSubject()) {
                    SubjectInfo subjectInfo = buildSubjectInfo(roleType.getRunAsSubject());
                    roleDesignates.put(roleName, subjectInfo);
                }

                for (int j = 0; j < roleType.sizeOfRealmPrincipalArray(); j++) {
                    Principal principal = buildRealmPrincipal(roleType.getRealmPrincipalArray(j), bundle);
                    add(roleName, principal, principalRoleMap);
                }

                for (int j = 0; j < roleType.sizeOfLoginDomainPrincipalArray(); j++) {
                    Principal principal = buildDomainPrincipal(roleType.getLoginDomainPrincipalArray(j), bundle);
                    add(roleName, principal, principalRoleMap);
                }

                for (int j = 0; j < roleType.sizeOfPrincipalArray(); j++) {
                    Principal principal = buildPrincipal(roleType.getPrincipalArray(j), bundle);
                    add(roleName, principal, principalRoleMap);
                }

            }
        }

        SubjectInfo defaultSubjectInfo = buildSubjectInfo(securityType.getDefaultSubject());
        AbstractNameQuery credentialStoreName;
        if (securityType.isSetCredentialStoreRef()) {
            PatternType credentialStoreType = securityType.getCredentialStoreRef();
            credentialStoreName = SingleGBeanBuilder.buildAbstractNameQuery(credentialStoreType, GBeanInfoBuilder.DEFAULT_J2EE_TYPE, Collections.singleton(CredentialStore.class.getName()));
        } else {
View Full Code Here

TOP

Related Classes of org.apache.geronimo.security.deploy.SubjectInfo

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.