示例#1
0
        /// <summary>
        /// Register an endpoint, or update an existing one.
        /// </summary>
        /// <param name="samlEndpoint">The endpoint to register.</param>
        public void RegisterEndpoint(SAMLEndpoint samlEndpoint)
        {
            var properties = new Dictionary <string, string>()
            {
                { SettingsConstants.EndpointField, samlEndpoint.EndpointUri.ToString() },
                { SettingsConstants.AuthenticationTypeField, samlEndpoint.AuthenticationType.ToString() }
            };

            settingsManager.RegisterObject(samlEndpoint.Name, properties);
        }
示例#2
0
        /// <summary>
        /// Get an endpoint, if it exists and is valid.
        /// </summary>
        /// <param name="endpointName">The name of the endpoint to get.</param>
        /// <param name="samlEndpoint">The endpoint, or null if it's invalid or doesn't exist.</param>
        /// <returns>True if the endpoint exists and is valid, false otherwise.</returns>
        public bool TryGetEndpoint(string endpointName, out SAMLEndpoint samlEndpoint)
        {
            samlEndpoint = null;

            try
            {
                samlEndpoint = GetEndpoint(endpointName);
            }
            catch (AmazonClientException e)
            {
                Logger.GetLogger(typeof(SAMLEndpointManager)).Error(e, "Unable to load SAML Endpoint '{0}'.", endpointName);
            }

            return(samlEndpoint != null);
        }