Пример #1
0
        public static void ErrorParser()
        {
            AccessTokenErrorResponse _parser = new AccessTokenErrorResponse();
            string source = "\u003Chead>\u003C/head>\u003Cbody>\u003Cpre style=\"word-wrap: break-word; white-space: pre-wrap;\">error=redirect_uri_mismatch&error_description=redirect_uri%20must%20match%20configuration\u003C/pre>\u003C/body>";


            bool parseResult = _parser.Validate(source);
        }
        /// <summary>
        /// Checks for the existence of Error Data in the posted page.
        /// </summary>
        /// <returns></returns>
        public async Task <bool> CheckForError()
        {
            bool returnValue = false;


            //get our body of html from our page, and check to see if there are any errors per the Salesforce documentation
            string javascriptExecution = AccessTokenErrorResponse.ERROR_CHECKING_JAVASCRIPT;
            var    result = await CommunitiesWebView.EvaluateJavaScriptAsync(javascriptExecution);

            //execute our expression tester to see if any errors are located.
            returnValue = _errorParser.Validate(result);

            if (returnValue)
            {
                System.Diagnostics.Debug.WriteLine(result);
            }

            return(returnValue);
        }