/** {@inheritDoc} */ @Override @Nullable public EntityDescriptor apply(@Nullable SAMLMetadataContext input) { if (null == input) { return null; } return input.getEntityDescriptor(); }
/** {@inheritDoc} */ @Override @Nullable public Boolean apply(@Nullable final RelyingPartyContext input) { final BaseContext ctx = input != null ? input.getRelyingPartyIdContextTree() : null; if (ctx != null) { if (ctx instanceof SAMLPeerEntityContext || ctx instanceof SAMLSelfEntityContext) { final SAMLMetadataContext mc = ctx.getSubcontext(SAMLMetadataContext.class); if (mc != null) { return mc.getEntityDescriptor() != null; } } } return false; }
/** {@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; }
final SAMLMetadataContext outboundMetadataCtx = peerContext.getSubcontext(SAMLMetadataContext.class, true); outboundMetadataCtx.setEntityDescriptor(inboundMetadataCtx.getEntityDescriptor()); outboundMetadataCtx.setRoleDescriptor(inboundMetadataCtx.getRoleDescriptor());
/** {@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()); } }
decodedCtx.getSAMLEndpointContext().setEndpoint(acsService); final EntityDescriptor metadata = context.getSAMLPeerMetadataContext().getEntityDescriptor(); if (metadata == null) { throw new SAMLException("IDP Metadata cannot be null");