public SAMLMessageContext sendMessage(SAMLMessageContext samlContext, boolean sign, String bindingName) throws SAMLException, MetadataProviderException, MessageEncodingException { return sendMessage(samlContext, sign, getBinding(bindingName)); }
/** * Determines binding to be used for the given endpoint. By default binding returned from getBinding call on the * endpoint is used. Speciall handling is used for Holder of Key WebSSO profile endpoints where real binding * is stored under hoksso:ProtocolBinding attribute. * * @param endpoint endpoint t * @return binding * @throws SAMLException in case binding can't be found * @throws MetadataProviderException in case binding of the endpoint can't be determined * @see SAMLUtil#getBindingForEndpoint(org.opensaml.saml2.metadata.Endpoint) */ protected SAMLBinding getBinding(Endpoint endpoint) throws SAMLException, MetadataProviderException { return getBinding(SAMLUtil.getBindingForEndpoint(endpoint)); }
/** * Loads incoming SAML message using one of the configured bindings and populates the SAMLMessageContext object with it. * * @param samlContext saml context * @param binding to use for message extraction * @return SAML message context with filled information about the message * @throws org.opensaml.common.SAMLException * error retrieving the message from the request * @throws org.opensaml.saml2.metadata.provider.MetadataProviderException * error retrieving metadat * @throws org.opensaml.ws.message.decoder.MessageDecodingException * error decoding the message * @throws org.opensaml.xml.security.SecurityException * error verifying message */ public SAMLMessageContext retrieveMessage(SAMLMessageContext samlContext, String binding) throws SAMLException, MetadataProviderException, MessageDecodingException, org.opensaml.xml.security.SecurityException { return retrieveMessage(samlContext, getBinding(binding)); }
/** * Loads incoming SAML message using one of the configured bindings and populates the SAMLMessageContext object with it. * * @param samlContext saml context * @return SAML message context with filled information about the message * @throws org.opensaml.common.SAMLException * error retrieving the message from the request * @throws org.opensaml.saml2.metadata.provider.MetadataProviderException * error retrieving metadat * @throws org.opensaml.ws.message.decoder.MessageDecodingException * error decoding the message * @throws org.opensaml.xml.security.SecurityException * error verifying message */ public SAMLMessageContext retrieveMessage(SAMLMessageContext samlContext) throws SAMLException, MetadataProviderException, MessageDecodingException, org.opensaml.xml.security.SecurityException { return retrieveMessage(samlContext, getBinding(samlContext.getInboundMessageTransport())); }
/** * Method sends SAML message contained in the context to the specified peerEntityEnpoint. Binding is automatically * determined based on the selected endpoint. * * @param samlContext context * @param sign true when sent message should be signed * @return resulting context, might be a copy */ public SAMLMessageContext sendMessage(SAMLMessageContext samlContext, boolean sign) throws SAMLException, MetadataProviderException, MessageEncodingException { Endpoint endpoint = samlContext.getPeerEntityEndpoint(); if (endpoint == null) { throw new SAMLException("Could not get peer entity endpoint"); } return sendMessage(samlContext, sign, getBinding(endpoint)); }