Package org.jasig.cas.client.authentication

Examples of org.jasig.cas.client.authentication.SimplePrincipal


                // Add group principal containing role data
                final Group roleGroup = new SimpleGroup(this.roleGroupName);

                for (final String defaultRole : defaultRoles) {
                    roleGroup.addMember(new SimplePrincipal(defaultRole));
                }

                final Map<String, Object> attributes = this.assertion.getPrincipal().getAttributes();
                for (final String key : attributes.keySet()) {
                    if (this.roleAttributeNames.contains(key)) {
                        // Attribute value is Object if singular or Collection if plural
                        final Object value = attributes.get(key);
                        if (value instanceof Collection<?>) {
                            for (final Object o : (Collection<?>) value) {
                                roleGroup.addMember(new SimplePrincipal(o.toString()));
                            }
                        } else {
                            roleGroup.addMember(new SimplePrincipal(value.toString()));
                        }
                    }
                }
                this.subject.getPrincipals().add(roleGroup);
View Full Code Here


            }
        }
    }

    private Object[] getTestSubjects() {
        final SimplePrincipal simplePrincipal = new SimplePrincipal("simple");
        final SimpleGroup simpleGroup = new SimpleGroup("group");
        final AttributePrincipalImpl attributePrincipal = new AttributePrincipalImpl("attr",
                Collections.<String, Object> singletonMap("LOA", "3"));
        final AssertionPrincipal assertionPrincipal = new AssertionPrincipal("assertion", new AssertionImpl(
                attributePrincipal, Collections.<String, Object> singletonMap("authenticationMethod", "username")));
View Full Code Here

TOP

Related Classes of org.jasig.cas.client.authentication.SimplePrincipal

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.