Пример #1
0
        /// <summary>
        /// Obtain the single logout resopnse location based on the given
        /// binding.
        /// </summary>
        /// <param name="binding">
        /// The binding (should be made into constants / types).
        /// </param>
        /// <returns>
        /// Service response location as defined in the metadata for the
        /// specified IDP and binding.
        /// </returns>
        public string GetSingleLogoutServiceResponseLocation(string binding)
        {
            var xpath = string.Format("/md:EntityDescriptor/md:IDPSSODescriptor/md:SingleLogoutService[@Binding='{0}']", binding);

            return
                (Saml2Utils.TryGetAttributeValue(_metadata, _metadataNsMgr, xpath, "ResponseLocation")
                 ??
                 Saml2Utils.TryGetAttributeValue(_metadata, _metadataNsMgr, xpath, "Location"));
        }
Пример #2
0
        /// <summary>
        /// Obtain the single logout location based on the given binding.
        /// </summary>
        /// <param name="binding">
        /// The binding (should be made into constants / types).
        /// </param>
        /// <returns>
        /// Service location as defined in the metadata for the specified IDP
        /// and binding.
        /// </returns>
        public string GetSingleLogoutServiceLocation(string binding)
        {
            var xpath = new StringBuilder();

            xpath.Append("/md:EntityDescriptor/md:IDPSSODescriptor/md:SingleLogoutService");
            xpath.Append("[@Binding='");
            xpath.Append(binding);
            xpath.Append("']");

            return(Saml2Utils.TryGetAttributeValue(_metadata, _metadataNsMgr, xpath.ToString(), "Location"));
        }
Пример #3
0
        /// <summary>
        /// Obtain the assertion consumer service location based on the given binding.
        /// </summary>
        /// <param name="binding">The binding associated with the desired consumer service.</param>
        /// <param name="index">The index associated with the desired consumer service.</param>
        /// <returns>Service location as defined in the metadata for the binding, null if not found.</returns>
        public string GetAssertionConsumerServiceLocation(string binding, string index)
        {
            var xpath = new StringBuilder();

            xpath.Append("/md:EntityDescriptor/md:SPSSODescriptor/md:AssertionConsumerService");
            xpath.Append("[@Binding='");
            xpath.Append(binding);
            xpath.Append("' and index='");
            xpath.Append(index);
            xpath.Append("']");

            return(Saml2Utils.TryGetAttributeValue(_metadata, _metadataNsMgr, xpath.ToString(), "Location"));
        }
Пример #4
0
        /// <summary>
        /// Obtain the single sign on location based on the given binding.
        /// </summary>
        /// <param name="binding">The binding (should be made into constants / types).</param>
        /// <returns>Service location as defined in the metadata for the specified IDP and binding.</returns>
        public string GetSingleSignOnServiceLocation(string binding)
        {
            var xpath = $"/md:EntityDescriptor/md:IDPSSODescriptor/md:SingleSignOnService[@Binding='{binding}']";

            return(Saml2Utils.TryGetAttributeValue(m_metadata, m_metadataNsMgr, xpath, "Location"));
        }
Пример #5
0
        /// <summary>
        /// Obtain the assertion consumer service location based on the given binding.
        /// </summary>
        /// <param name="binding">The binding associated with the desired consumer service.</param>
        /// <param name="index">The index associated with the desired consumer service.</param>
        /// <returns>Service location as defined in the metadata for the binding, null if not found.</returns>
        public string GetAssertionConsumerServiceLocation(string binding, string index)
        {
            var xpath = $"/md:EntityDescriptor/md:SPSSODescriptor/md:AssertionConsumerService[@Binding='{binding}' and index='{index}']";

            return(Saml2Utils.TryGetAttributeValue(m_metadata, m_metadataNsMgr, xpath, "Location"));
        }