Package org.apache.geronimo.security.realm.providers

Examples of org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal


            used = true;
            return true;
        }

        public boolean commit() throws LoginException {
            subject.getPrincipals().add(new GeronimoGroupPrincipal("Foo"));
            return true;
        }
View Full Code Here


    public void testGetCallerPrincipal() throws Exception {
        Subject subject = new Subject();
        GeronimoUserPrincipal userPrincipal = new GeronimoUserPrincipal("foo");
        RealmPrincipal realmPrincipal = new RealmPrincipal("realm", "domain", userPrincipal);
        PrimaryRealmPrincipal primaryRealmPrincipal = new PrimaryRealmPrincipal("realm", "domain", userPrincipal);
        GeronimoGroupPrincipal groupPrincipal = new GeronimoGroupPrincipal("bar");
        Set principals = subject.getPrincipals();
        principals.add(userPrincipal);
        principals.add(realmPrincipal);
        principals.add(primaryRealmPrincipal);
        principals.add(groupPrincipal);
View Full Code Here

        public boolean login() throws LoginException {
            return true;
        }

        public boolean commit() throws LoginException {
            subject.getPrincipals().add(new GeronimoGroupPrincipal("Foo"));
            return true;
        }
View Full Code Here

        public boolean login() throws LoginException {
            return true;
        }

        public boolean commit() throws LoginException {
            subject.getPrincipals().add(new GeronimoGroupPrincipal("Bar"));
            return true;
        }
View Full Code Here

            //check the credentials by binding to server
            if (bindUser(context, dn, password)) {
                //if authenticated add more roles
                roles = getRoles(context, dn, username, roles);
                for (int i = 0; i < roles.size(); i++) {
                    groups.add(new GeronimoGroupPrincipal((String) roles.get(i)));
                }
            } else {
                return false;
            }
        } catch (CommunicationException e) {
View Full Code Here

        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();
        uncheckedPermissions.add(new WebUserDataPermission("/protected/*", ""));

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

                Subject subject = new Subject();
                subject.getPrincipals().add(userPrincipal);
                List<String> usersGroups = groups.get(userName);
                if (usersGroups != null) {
                    for (String group: usersGroups) {
                        subject.getPrincipals().add(new GeronimoGroupPrincipal(group));
                    }
                }
                return identityService.newUserIdentity(subject, userPrincipal, null);
            }
            return null;
View Full Code Here

            Set users = (Set) groups.get(groupName);
            Iterator iter = users.iterator();
            while (iter.hasNext()) {
                String user = (String) iter.next();
                if (username.equals(user)) {
                    principals.add(new GeronimoGroupPrincipal(groupName));
                    break;
                }
            }
        }
View Full Code Here

    public void testGetCallerPrincipal() throws Exception {
        Subject subject = new Subject();
        GeronimoUserPrincipal userPrincipal = new GeronimoUserPrincipal("foo");
        RealmPrincipal realmPrincipal = new RealmPrincipal("realm", "domain", userPrincipal);
        PrimaryRealmPrincipal primaryRealmPrincipal = new PrimaryRealmPrincipal("realm", "domain", userPrincipal);
        GeronimoGroupPrincipal groupPrincipal = new GeronimoGroupPrincipal("bar");
        Set principals = subject.getPrincipals();
        principals.add(userPrincipal);
        principals.add(realmPrincipal);
        principals.add(primaryRealmPrincipal);
        principals.add(groupPrincipal);
View Full Code Here

            used = true;
            return true;
        }

        public boolean commit() throws LoginException {
            subject.getPrincipals().add(new GeronimoGroupPrincipal("Foo"));
            return true;
        }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal

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.