Example #1
0
        internal static bool IsWindowsAuth(AuthenticationSchemes authScheme)
        {
            Contract.Assert(authScheme.IsSingleton(), "authenticationScheme used in an Http(s)ChannelFactory must be a singleton value.");

            return(authScheme == AuthenticationSchemes.Negotiate ||
                   authScheme == AuthenticationSchemes.Ntlm);
        }
        private bool IsDigestAuthenticationScheme(SecurityTokenRequirement requirement)
        {
            if (requirement.Properties.ContainsKey(ServiceModelSecurityTokenRequirement.HttpAuthenticationSchemeProperty))
            {
                AuthenticationSchemes authScheme = (AuthenticationSchemes)requirement.Properties[ServiceModelSecurityTokenRequirement.HttpAuthenticationSchemeProperty];

                if (!authScheme.IsSingleton())
                {
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("authScheme", string.Format(SR.HttpRequiresSingleAuthScheme, authScheme));
                }

                return(authScheme == AuthenticationSchemes.Digest);
            }
            else
            {
                return(false);
            }
        }