public final SPSSODescriptor getSPSSODescriptor() { final SAMLMetadataContext selfContext = getSAMLSelfMetadataContext(); final SPSSODescriptor spDescriptor = (SPSSODescriptor) selfContext.getRoleDescriptor(); return spDescriptor; }
public final IDPSSODescriptor getIDPSSODescriptor() { final SAMLMetadataContext peerContext = getSAMLPeerMetadataContext(); final IDPSSODescriptor idpssoDescriptor = (IDPSSODescriptor) peerContext.getRoleDescriptor(); return idpssoDescriptor; }
/** {@inheritDoc} */ @Override @Nullable public SSODescriptor apply(@Nullable final ProfileRequestContext input) { if (input != null && input.getInboundMessageContext() != null) { final SAMLPeerEntityContext peerCtx = input.getInboundMessageContext().getSubcontext(SAMLPeerEntityContext.class); if (peerCtx != null) { SAMLMetadataContext mdCtx = peerCtx.getSubcontext(SAMLMetadataContext.class); if (mdCtx != null && mdCtx.getRoleDescriptor() != null && mdCtx.getRoleDescriptor() instanceof SSODescriptor) { return (SSODescriptor) mdCtx.getRoleDescriptor(); } else { log.debug("No SAMLMetadataContext or SSODescriptor role available"); } } else { log.debug("No SAMLPeerEntityContext available"); } } else { log.debug("No inbound message context available"); } return null; } }
roleDescriptor = samlMetadataContext.getRoleDescriptor(); if (roleDescriptor == null) { log.debug("No RoleDescriptor was available, skipping further delegation processing");
if (metadataContext == null || metadataContext.getRoleDescriptor() == null) { log.warn("SAMLPeerContext did not contain either a SAMLMetadataContext or a RoleDescriptor, " + "unable to evaluate rule"); if (!(metadataContext.getRoleDescriptor() instanceof SPSSODescriptor)) { log.warn("RoleDescriptor was not an SPSSODescriptor, it was a {}. Unable to evaluate rule", metadataContext.getRoleDescriptor().getClass().getName()); return; SPSSODescriptor spssoRole = (SPSSODescriptor) metadataContext.getRoleDescriptor();
log.debug("{} No metadata context found, nothing to do", getLogPrefix()); return; } else if (!(metadataContext.getRoleDescriptor() instanceof SPSSODescriptor)) { log.debug("{} Metadata context did not contain an SPSSODescriptor, nothing to do", getLogPrefix()); return; final SPSSODescriptor ssoDescriptor = (SPSSODescriptor) metadataContext.getRoleDescriptor();
/** {@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; }
if (metadataCtx != null && metadataCtx.getRoleDescriptor() != null) { log.debug("{} Adding metadata to resolution criteria for signing/digest algorithms", getLogPrefix()); criteria.add(new RoleDescriptorCriterion(metadataCtx.getRoleDescriptor()));
if (metadataCtx != null && metadataCtx.getRoleDescriptor() != null) { log.debug("{} Adding role metadata to resolution criteria", getLogPrefix()); criteria.add(new RoleDescriptorCriterion(metadataCtx.getRoleDescriptor()));
if (mdContext != null && mdContext.getRoleDescriptor() != null) { criteria.add(new RoleDescriptorCriterion(mdContext.getRoleDescriptor())); } else { log.debug("{} No metadata available for endpoint resolution", getLogPrefix());
/** {@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()); } }
peerContext.getSubcontext(SAMLMetadataContext.class, true); outboundMetadataCtx.setEntityDescriptor(inboundMetadataCtx.getEntityDescriptor()); outboundMetadataCtx.setRoleDescriptor(inboundMetadataCtx.getRoleDescriptor());