/** * Get the SAML artifact type from the message context. * * @param messageContext the message context * * @return the artifact type */ @Nullable private byte[] getSAMLArtifactType(@Nonnull final MessageContext<SAMLObject> messageContext) { return messageContext.getSubcontext(SAMLArtifactContext.class, true).getArtifactType(); }
/** * Gets the index of the source artifact resolution service. * * @param requestContext current request context * * @return the index of the attribute resolution service */ @Nullable protected Integer getArsEndpointIndex(@Nonnull final MessageContext<SAMLObject> requestContext) { final SAMLArtifactContext artifactContext = getArtifactContext(requestContext); if (artifactContext == null || artifactContext.getSourceArtifactResolutionServiceEndpointIndex() == null) { log.warn("No artifact resolution service endpoint index is available"); return null; } return artifactContext.getSourceArtifactResolutionServiceEndpointIndex(); }
/** * Gets the index of the source artifact resolution service. * * @param requestContext current request context * * @return the index of the attribute resolution service */ @Nullable protected String getArsEndpointUrl(@Nonnull final MessageContext<SAMLObject> requestContext) { SAMLArtifactContext artifactContext = getArtifactContext(requestContext); if (artifactContext == null || artifactContext.getSourceArtifactResolutionServiceEndpointURL() == null) { log.warn("No artifact resolution service endpoint URL is available"); return null; } return artifactContext.getSourceArtifactResolutionServiceEndpointURL(); }
private void prepareArtifactContext(final Response samlResponse, final MessageContext ctx) { val art = ctx.getSubcontext(SAMLArtifactContext.class, true); art.setArtifactType(SAML2ArtifactType0004.TYPE_CODE); art.setSourceEntityId(samlResponse.getIssuer().getValue()); val svc = adaptor.getAssertionConsumerServiceForArtifactBinding(); art.setSourceArtifactResolutionServiceEndpointIndex(svc.getIndex()); art.setSourceArtifactResolutionServiceEndpointURL(svc.getLocation()); } }
if (artifactConfiguration != null) { final SAMLArtifactContext artifactCtx = artifactContextLookupStrategy.apply(profileRequestContext); artifactCtx.setArtifactType(artifactConfiguration.getArtifactType()); artifactCtx.setSourceArtifactResolutionServiceEndpointURL( artifactConfiguration.getArtifactResolutionServiceURL()); artifactCtx.setSourceArtifactResolutionServiceEndpointIndex( artifactConfiguration.getArtifactResolutionServiceIndex());
/** * Store the SAML artifact type in the message context. * * @param messageContext the message context * * @param artifactType the artifact type to store */ private void storeSAMLArtifactType(@Nonnull final MessageContext<SAMLObject> messageContext, @Nonnull @NotEmpty final byte[] artifactType) { messageContext.getSubcontext(SAMLArtifactContext.class, true).setArtifactType(artifactType); }
/** * Get the local entityId. * * @param requestContext the message context * * @return the local entityId */ @Nullable protected String getSourceEntityId(@Nonnull final MessageContext<SAMLObject> requestContext) { final SAMLArtifactContext artifactContext = getArtifactContext(requestContext); if (artifactContext != null) { if (artifactContext.getSourceEntityId() != null) { return artifactContext.getSourceEntityId(); } else { log.warn("SAMLArtifactContext did not contain a source entityID"); } } else { log.warn("Message context did not contain a SAMLArtifactContext"); } return null; }
/** * Get the artifact source entityID. * * @return the source entityID, may be null */ @Nullable @NotEmpty public String getSourceEntityId() { if (sourceEntityId == null) { if (getParent() != null) { final SAMLSelfEntityContext self = getParent().getSubcontext(SAMLSelfEntityContext.class); if (self != null) { sourceEntityId = self.getEntityId(); } } } return sourceEntityId; }
/** * Store the SAML artifact type in the message context. * * @param messageContext the message context * * @param artifactType the artifact type to store */ private void storeSAMLArtifactType(@Nonnull final MessageContext<SAMLObject> messageContext, @Nonnull @NotEmpty final byte[] artifactType) { messageContext.getSubcontext(SAMLArtifactContext.class, true).setArtifactType(artifactType); }
/** * Get the local entityId. * * @param requestContext the message context * * @return the local entityId */ @Nullable protected String getSourceEntityId(@Nonnull final MessageContext<SAMLObject> requestContext) { final SAMLArtifactContext artifactContext = getArtifactContext(requestContext); if (artifactContext != null) { if (artifactContext.getSourceEntityId() != null) { return artifactContext.getSourceEntityId(); } else { log.warn("SAMLArtifactContext did not contain a source entityID"); } } else { log.warn("Message context did not contain a SAMLArtifactContext"); } return null; }
/** * Get the SAML artifact type from the message context. * * @param messageContext the message context * * @return the artifact type */ @Nullable private byte[] getSAMLArtifactType(@Nonnull final MessageContext<SAMLObject> messageContext) { return messageContext.getSubcontext(SAMLArtifactContext.class, true).getArtifactType(); }