public void setSupportedOutboundBindings(List<String> bindings) {
supportedOutboundBindings = bindings;
}
-
+
/** {@inheritDoc} */
public RelyingPartyConfiguration getRelyingPartyConfiguration(String relyingPartyId) {
- try{
- if(getMetadataProvider().getEntityDescriptor(relyingPartyId) == null){
- log.warn("No metadata for relying party {}, treating party as anonymous", relyingPartyId);
- return getRelyingPartyConfigurationManager().getAnonymousRelyingConfiguration();
- }
- }catch(MetadataProviderException e){
+ try {
+ if (getMetadataProvider().getEntityDescriptor(relyingPartyId) == null) {
+ log.warn("No metadata for relying party {}, treating party as anonymous", relyingPartyId);
+ return getRelyingPartyConfigurationManager().getAnonymousRelyingConfiguration();
+ }
+ } catch (MetadataProviderException e) {
log.error("Unable to look up relying party metadata", e);
return null;
}
-
+
return super.getRelyingPartyConfiguration(relyingPartyId);
}
protected void populateRelyingPartyInformation(BaseSAMLProfileRequestContext requestContext)
throws ProfileException {
MetadataProvider metadataProvider = requestContext.getMetadataProvider();
- String relyingPartyId = requestContext.getPeerEntityId();
+ String relyingPartyId = requestContext.getInboundMessageIssuer();
EntityDescriptor relyingPartyMetadata;
try {
* @throws ProfileException thrown if there is a problem populating the profile information
*/
protected void populateProfileInformation(BaseSAMLProfileRequestContext requestContext) throws ProfileException {
- requestContext.setCommunicationProfileId(getProfileId());
AbstractSAMLProfileConfiguration profileConfig = (AbstractSAMLProfileConfiguration) requestContext
.getRelyingPartyConfiguration().getProfileConfiguration(getProfileId());
if (profileConfig != null) {
requestContext.setOutboundMessageArtifactType(profileConfig.getOutboundArtifactType());
}
- requestContext.setPeerEntityEndpoint(selectEndpoint(requestContext));
+ Endpoint endpoint = selectEndpoint(requestContext);
+ if (endpoint == null) {
+ log.error("No return endpoint available for relying party {}", requestContext.getInboundMessageIssuer());
+ throw new ProfileException("No peer endpoint available to which to send SAML response");
+ }
+ requestContext.setPeerEntityEndpoint(endpoint);
}
/**
*/
protected void encodeResponse(BaseSAMLProfileRequestContext requestContext) throws ProfileException {
try {
-
- Endpoint peerEndpoint = requestContext.getPeerEntityEndpoint();
- if (peerEndpoint == null) {
- log
- .error("No return endpoint available for relying party {}", requestContext
- .getInboundMessageIssuer());
- throw new ProfileException("No peer endpoint available to which to send SAML response");
- }
-
SAMLMessageEncoder encoder = getMessageEncoders().get(requestContext.getPeerEntityEndpoint().getBinding());
if (encoder == null) {
log.error("No outbound message encoder configured for binding {}", requestContext