public void performMapping(Map<String, Object> map, List<Attribute<String>> mappedObject) { List<Attribute<String>> attList = new ArrayList<Attribute<String>>(); //Get the Principal Principal principal = (Principal) map.get(SecurityConstants.PRINCIPAL_IDENTIFIER); if(principal != null) { String principalName = principal.getName(); //Get the email address String emailAddress = (String) options.get(principalName + ".email"); Attribute<String> att = AttributeFactory.createEmailAddress(emailAddress); attList.add(att); } mappedObject.addAll(attList); result.setMappedObject(mappedObject); }
public void performMapping(Map<String,Object> contextMap, Principal principal) { if(contextMap == null) throw new IllegalArgumentException("ContextMap is null"); X509Certificate[] certs = (X509Certificate[]) contextMap.get("X509"); if(certs != null) { SubjectDNMapping sdn = new SubjectDNMapping(); principal = sdn.toPrinicipal(certs); if(log.isTraceEnabled()) log.trace("Mapped to Principal:"+principal); } result.setMappedObject(principal); } }
public void performMapping(Map<String, Object> map, Principal mappedObject) { if(mappedObject instanceof SimplePrincipal == false) return; SimplePrincipal simplePrincipal = (SimplePrincipal) mappedObject; if(principalMapProperties != null) { String newPrincipalName = principalMapProperties.getProperty(simplePrincipal.getName()); if(newPrincipalName != null && newPrincipalName.length() > 0) { result.setMappedObject(new SimplePrincipal(newPrincipalName)); } } }
public void performMapping(Map<String,Object> contextMap, Principal principal) { if(principal instanceof X500Principal == false) return; if(contextMap == null) throw new IllegalArgumentException("ContextMap is null"); X509Certificate[] certs = (X509Certificate[]) contextMap.get("X509"); if(certs != null) { SubjectCNMapping sdn = new SubjectCNMapping(); principal = sdn.toPrinicipal(certs); if(log.isTraceEnabled()) log.trace("Mapped to Principal:"+principal); } result.setMappedObject(principal); } }
public void performMapping(Map<String, Object> contextMap, RoleGroup mappedObject) { if (contextMap == null || contextMap.isEmpty()) throw PicketBoxMessages.MESSAGES.invalidNullArgument("contextMap"); //Obtain the principal to roles mapping Principal principal = getCallerPrincipal(contextMap); if (principal != null && rolesQuery != null) { String username = principal.getName(); Util.addRolesToGroup(username, mappedObject, dsJndiName, rolesQuery, suspendResume, tm); result.setMappedObject(mappedObject); } }
public void performMapping(Map<String, Object> contextMap, RoleGroup mappedObject) { if (contextMap == null || contextMap.isEmpty()) throw PicketBoxMessages.MESSAGES.invalidNullArgument("contextMap"); //Obtain the principal to roles mapping Principal principal = getCallerPrincipal(contextMap); if (principal != null) { String username = principal.getName(); Util.addRolesToGroup(username, mappedObject, roles); result.setMappedObject(mappedObject); } }
result.setMappedObject(mappedObject); return ; // No Mapping result.setMappedObject(mappedObject);
result.setMappedObject(mappedObject); return ; // No Mapping result.setMappedObject(mappedObject);
public void performMapping(Map<String,Object> contextMap, Principal principal) { if(contextMap == null) throw PicketBoxMessages.MESSAGES.invalidNullArgument("contextMap"); X509Certificate[] certs = (X509Certificate[]) contextMap.get("X509"); if(certs != null) { SubjectDNMapping sdn = new SubjectDNMapping(); principal = sdn.toPrinicipal(certs); PicketBoxLogger.LOGGER.traceMappedX500Principal(principal); } result.setMappedObject(principal); } }
public void performMapping(Map<String,Object> contextMap, Principal principal) { if(principal instanceof X500Principal == false) return; if(contextMap == null) throw PicketBoxMessages.MESSAGES.invalidNullArgument("contextMap"); X509Certificate[] certs = (X509Certificate[]) contextMap.get("X509"); if(certs != null) { SubjectCNMapping sdn = new SubjectCNMapping(); principal = sdn.toPrinicipal(certs); PicketBoxLogger.LOGGER.traceMappedX500Principal(principal); } result.setMappedObject(principal); } }
result.setMappedObject(mappedObject);
result.setMappedObject(mappedObject); return ; // No Mapping mappedObject.addAll(newRoles.getRoles()); result.setMappedObject(mappedObject);
result.setMappedObject(mappedObject);
mappingResult.setMappedObject(mappedObject);
public void performMapping(Map<String, Object> contextMap, Principal principal) { if (contextMap == null) { logger.mappingContextNull(); } Object tokenObject = contextMap.get(AbstractSTSLoginModule.SHARED_TOKEN); if (!(tokenObject instanceof Element)) { // With Tomcat SSO Valves, mapping providers DO get called automatically, so there may be no tokens and errors // should be expected and handled logger.debug("Did not find a token " + Element.class .getName() + " under " + AbstractSTSLoginModule.SHARED_TOKEN + " in the map"); } try { Element tokenElement = (Element) tokenObject; AssertionType assertion = SAMLUtil.fromElement(tokenElement); SubjectType subject = assertion.getSubject(); if (subject != null) { BaseIDAbstractType baseID = subject.getSubType().getBaseID(); if (baseID != null && baseID instanceof NameIDType) { NameIDType nameID = (NameIDType) baseID; Principal mappedPrincipal = new SimplePrincipal(nameID.getValue()); result.setMappedObject(mappedPrincipal); logger.trace("Mapped principal = " + mappedPrincipal); return; } } } catch (Exception e) { logger.samlAssertionPasingFailed(e); } }
public void performMapping(Map<String, Object> contextMap, Principal principal) { if (contextMap == null) { logger.mappingContextNull(); } Object tokenObject = contextMap.get(AbstractSTSLoginModule.SHARED_TOKEN); if (!(tokenObject instanceof Element)) { // With Tomcat SSO Valves, mapping providers DO get called automatically, so there may be no tokens and errors // should be expected and handled logger.debug("Did not find a token " + Element.class .getName() + " under " + AbstractSTSLoginModule.SHARED_TOKEN + " in the map"); } try { Element tokenElement = (Element) tokenObject; AssertionType assertion = SAMLUtil.fromElement(tokenElement); SubjectType subject = assertion.getSubject(); if (subject != null) { BaseIDAbstractType baseID = subject.getSubType().getBaseID(); if (baseID != null && baseID instanceof NameIDType) { NameIDType nameID = (NameIDType) baseID; Principal mappedPrincipal = new SimplePrincipal(nameID.getValue()); result.setMappedObject(mappedPrincipal); logger.trace("Mapped principal = " + mappedPrincipal); return; } } } catch (Exception e) { logger.samlAssertionPasingFailed(e); } }
result.setMappedObject(rolesGroup);
result.setMappedObject(rolesGroup);