Examples of STSPrincipalMappingProvider


Examples of org.picketlink.identity.federation.bindings.jboss.auth.mapping.STSPrincipalMappingProvider

                if (assertionElement != null) {
                    Subject sts_subject = new Subject();
                    boolean sts_mapped = false;
                    Map<String, Object> contextMap = new HashMap<String, Object>();
                    contextMap.put(AbstractSTSLoginModule.SHARED_TOKEN, assertionElement);
                    STSPrincipalMappingProvider principalMapper = new STSPrincipalMappingProvider();
                    principalMapper.init(contextMap);
                    MappingResult<Principal> principalResult = new MappingResult<Principal>();
                    principalMapper.setMappingResult(principalResult);
                    principalMapper.performMapping(contextMap, null);
                    Principal principal = principalResult.getMappedObject();
                    if (principal != null) {
                        sts_subject.getPrincipals().add(new UserPrincipal(principal.getName()));
                        sts_mapped = true;
                    }
View Full Code Here

Examples of org.picketlink.identity.federation.bindings.jboss.auth.mapping.STSPrincipalMappingProvider

        MappingResult<Principal> mappingResult = new MappingResult<Principal>();
        Map<String, Object> contextMap = new HashMap<String, Object>();
        Element assertionElement = SAMLUtil.toElement(assertion);
        contextMap.put(AbstractSTSLoginModule.SHARED_TOKEN, assertionElement);

        MappingProvider<Principal> mappingProvider = new STSPrincipalMappingProvider();
        mappingProvider.init(contextMap);
        mappingProvider.setMappingResult(mappingResult);
        mappingProvider.performMapping(contextMap, null);

        Principal principal = mappingResult.getMappedObject();
        assertNotNull("Unexpected null mapped principal", principal);
        assertEquals("Principal has unexpected value", userId, principal.getName());
    }
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.