internal static AuthenticationChallenge Parse(string value)
        {
            AuthenticationChallenge authenticationChallenge;
            AuthenticationChallenge authenticationChallenge1;

            string[] strArrays = value.Split(new char[] { ' ' }, 2);
            if ((int)strArrays.Length == 2)
            {
                string lower = strArrays[0].ToLower();
                if (lower == "basic")
                {
                    authenticationChallenge1 = new AuthenticationChallenge(AuthenticationSchemes.Basic, AuthenticationBase.ParseParameters(strArrays[1]));
                }
                else if (lower == "digest")
                {
                    authenticationChallenge1 = new AuthenticationChallenge(AuthenticationSchemes.Digest, AuthenticationBase.ParseParameters(strArrays[1]));
                }
                else
                {
                    authenticationChallenge1 = null;
                }
                authenticationChallenge = authenticationChallenge1;
            }
            else
            {
                authenticationChallenge = null;
            }
            return(authenticationChallenge);
        }
Exemple #2
0
 internal static AuthenticationResponse Parse(string value)
 {
     //Discarded unreachable code: IL_0079
     try
     {
         string[] array = value.Split(new char[1] {
             ' '
         }, 2);
         if (array.Length != 2)
         {
             return(null);
         }
         string text = array[0].ToLower();
         return((text == "basic") ? new AuthenticationResponse(AuthenticationSchemes.Basic, ParseBasicCredentials(array[1])) : ((!(text == "digest")) ? null : new AuthenticationResponse(AuthenticationSchemes.Digest, AuthenticationBase.ParseParameters(array[1]))));
     }
     catch
     {
     }
     return(null);
 }
        internal static AuthenticationResponse Parse(string value)
        {
            AuthenticationResponse authenticationResponse;
            AuthenticationResponse authenticationResponse1;

            try
            {
                string[] strArrays = value.Split(new char[] { ' ' }, 2);
                if ((int)strArrays.Length == 2)
                {
                    string lower = strArrays[0].ToLower();
                    if (lower == "basic")
                    {
                        authenticationResponse1 = new AuthenticationResponse(AuthenticationSchemes.Basic, AuthenticationResponse.ParseBasicCredentials(strArrays[1]));
                    }
                    else if (lower == "digest")
                    {
                        authenticationResponse1 = new AuthenticationResponse(AuthenticationSchemes.Digest, AuthenticationBase.ParseParameters(strArrays[1]));
                    }
                    else
                    {
                        authenticationResponse1 = null;
                    }
                    authenticationResponse = authenticationResponse1;
                    return(authenticationResponse);
                }
                else
                {
                    authenticationResponse = null;
                    return(authenticationResponse);
                }
            }
            catch
            {
            }
            authenticationResponse = null;
            return(authenticationResponse);
        }
        internal static AuthenticationChallenge Parse(string value)
        {
            string[] array = value.Split(new char[1] {
                ' '
            }, 2);
            if (array.Length != 2)
            {
                return(null);
            }
            string text = array[0].ToLower();

            return((text == "basic") ? new AuthenticationChallenge(AuthenticationSchemes.Basic, AuthenticationBase.ParseParameters(array[1])) : ((!(text == "digest")) ? null : new AuthenticationChallenge(AuthenticationSchemes.Digest, AuthenticationBase.ParseParameters(array[1]))));
        }