/** * Apply mapping semantics on the passed object * @param contextMap Read-only Contextual Map * @param mappedObject an object on which mapping will be applied */ public void performMapping(Map<String,Object> contextMap, T mappedObject) { int len = modules.size(); result = new MappingResult<T>(); for(int i = 0 ; i < len; i++) { MappingProvider<T> mp = (MappingProvider<T>)modules.get(i); mp.setMappingResult(result); mp.performMapping(contextMap, mappedObject); } }
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); }
mappedUserRoles = mc.getMappingResult().getMappedObject(); if(trace) log.trace("Roles after mapping:"+ userRoles);
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())); MappingResult<RoleGroup> rolesResult = new MappingResult<RoleGroup>(); rolesMapper.setMappingResult(rolesResult); rolesMapper.performMapping(contextMap, null); RoleGroup roleGroup = rolesResult.getMappedObject(); if (roleGroup != null) { GroupPrincipal roles = null;
logger.attributeManagerError(e); attList = (List<Attribute<Object>>) mc.getMappingResult().getMappedObject();
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())); MappingResult<RoleGroup> rolesResult = new MappingResult<RoleGroup>(); rolesMapper.setMappingResult(rolesResult); rolesMapper.performMapping(contextMap, null); RoleGroup roleGroup = rolesResult.getMappedObject(); if (roleGroup != null) { GroupPrincipal roles = null;
logger.attributeManagerError(e); attList = (List<Attribute<Object>>) mc.getMappingResult().getMappedObject();
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); } }
/** * Apply mapping semantics on the passed object * @param contextMap Read-only Contextual Map * @param mappedObject an object on which mapping will be applied */ public void performMapping(Map<String,Object> contextMap, T mappedObject) { int len = modules.size(); result = new MappingResult<T>(); for(int i = 0 ; i < len; i++) { MappingProvider<T> mp = (MappingProvider<T>)modules.get(i); mp.setMappingResult(result); mp.performMapping(contextMap, mappedObject); } }
Principal principal = principalMappingContext.getMappingResult().getMappedObject(); subject.getPrincipals().add(principal); RoleGroup group = roleMappingContext.getMappingResult().getMappedObject();
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)); } } }
/** * Apply mapping semantics on the passed object * @param contextMap Read-only Contextual Map * @param mappedObject an object on which mapping will be applied */ public void performMapping(Map<String,Object> contextMap, T mappedObject) { int len = modules.size(); result = new MappingResult<T>(); for(int i = 0 ; i < len; i++) { MappingProvider<T> mp = (MappingProvider<T>)modules.get(i); mp.setMappingResult(result); mp.performMapping(contextMap, mappedObject); } }
Principal principal = principalMappingContext.getMappingResult().getMappedObject(); subject.getPrincipals().add(principal); RoleGroup group = roleMappingContext.getMappingResult().getMappedObject();
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); } }
Principal principal = principalMappingContext.getMappingResult().getMappedObject(); subject.getPrincipals().add(principal); RoleGroup group = roleMappingContext.getMappingResult().getMappedObject();
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); } }
Principal principal = principalMappingContext.getMappingResult().getMappedObject(); subject.getPrincipals().add(principal); RoleGroup group = roleMappingContext.getMappingResult().getMappedObject();
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); } }
Principal principal = principalMappingContext.getMappingResult().getMappedObject(); subject.getPrincipals().add(principal); RoleGroup group = roleMappingContext.getMappingResult().getMappedObject();
result.setMappedObject(mappedObject); return ; // No Mapping result.setMappedObject(mappedObject);