/** {@inheritDoc} */ @Override @Nullable public AttributeConsumingService apply(@Nullable final AttributeConsumingServiceContext input) { if (null == input) { return null; } return input.getAttributeConsumingService(); }
samlMetadataContext.getSubcontext(AttributeConsumingServiceContext.class); if (acsContext != null) { attributeConsumingService = acsContext.getAttributeConsumingService();
/** {@inheritDoc} */ @Override protected boolean doPreExecute(final ProfileRequestContext profileRequestContext) { if (!super.doPreExecute(profileRequestContext)) { return false; } final SAMLMetadataContext metadataContext = metadataContextLookupStrategy.apply(profileRequestContext); if (null == metadataContext) { return false; } entityDescriptor = metadataContext.getEntityDescriptor(); if (null == entityDescriptor) { return false; } final RoleDescriptor roleDescriptor = metadataContext.getRoleDescriptor(); if (roleDescriptor instanceof SPSSODescriptor) { spSSODescriptor = (SPSSODescriptor) roleDescriptor; } final AttributeConsumingServiceContext acsCtx = metadataContext.getSubcontext(AttributeConsumingServiceContext.class); if (null != acsCtx) { acsDesriptor = acsCtx.getAttributeConsumingService(); } return true; }
/** {@inheritDoc}*/ protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext) { if (acsContext == null) { log.trace("{} AttributeConsumingServiceContext not found", getLogPrefix()); return; } final AttributeConsumingService acs = acsContext.getAttributeConsumingService(); if (acs == null) { log.trace("{} no AttributeConsumingService to map", getLogPrefix()); return; } if (acs.getRequestAttributes().isEmpty() || acs.getObjectMetadata().containsKey(AttributesMapContainer.class) || acs.getParent() != null) { log.trace("{} skipping mapping for AttributeConsumingService", getLogPrefix()); // Nothing to map, already mapped, or attached to metadata (and hence already scanned) return; } try { final AttributeMappingNodeProcessor processor = new AttributeMappingNodeProcessor(attributeResolverService); log.debug("{} mapping requested Attributes for generated AttributeConsumingService", getLogPrefix()); processor.process(acs); } catch (final FilterException e) { log.error("{} Error mapping Attributesresponding to request", getLogPrefix(), e); ActionSupport.buildEvent(profileRequestContext, EventIds.RUNTIME_EXCEPTION); } }
/** {@inheritDoc} */ @Override protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext) { final MessageContext msgCtx = new MessageContext(); profileRequestContext.setOutboundMessageContext(msgCtx); final SAMLSelfEntityContext selfContext = msgCtx.getSubcontext(SAMLSelfEntityContext.class, true); selfContext.setEntityId(selfIdentityLookupStrategy.apply(profileRequestContext)); final SAMLPeerEntityContext peerContext = msgCtx.getSubcontext(SAMLPeerEntityContext.class, true); peerContext.setEntityId(peerEntityCtx.getEntityId()); final SAMLMetadataContext inboundMetadataCtx = peerEntityCtx.getSubcontext(SAMLMetadataContext.class); if (inboundMetadataCtx != null) { final SAMLMetadataContext outboundMetadataCtx = peerContext.getSubcontext(SAMLMetadataContext.class, true); outboundMetadataCtx.setEntityDescriptor(inboundMetadataCtx.getEntityDescriptor()); outboundMetadataCtx.setRoleDescriptor(inboundMetadataCtx.getRoleDescriptor()); final AttributeConsumingServiceContext acsCtx = inboundMetadataCtx.getSubcontext(AttributeConsumingServiceContext.class); if (null != acsCtx) { outboundMetadataCtx.getSubcontext(AttributeConsumingServiceContext.class, true) .setAttributeConsumingService(acsCtx.getAttributeConsumingService()); } } log.debug("{} Initialized outbound message context", getLogPrefix()); } }