OnAuthenticationResponseArrived() public static method

public static OnAuthenticationResponseArrived ( AuthenticationResponseEventArgs e ) : void
e AuthenticationResponseEventArgs
return void
Ejemplo n.º 1
0
        public override void OnReceivedError(WebView view, ClientError errorCode, string description, string failingUrl)
        {
            base.OnReceivedError(view, errorCode, description, failingUrl);
            var error = String.Format("Code:{0}, Description: {1}", errorCode, description);

            AuthenticationEventManager.OnAuthenticationResponseArrived(new AuthenticationResponseEventArgs {
                Success = false, ErrorMessage = error
            });
        }
Ejemplo n.º 2
0
        public void getTitleCallback(String jsResult)
        {
            Console.WriteLine(jsResult);
            var payload  = Encoding.UTF8.GetString(Convert.FromBase64String(jsResult.Replace("Success payload=", String.Empty)));
            var rawToken = JsonConvert.DeserializeObject <Dictionary <string, string> > (payload);

            AuthenticationEventManager.OnAuthenticationResponseArrived(new AuthenticationResponseEventArgs {
                Success   = true,
                TokenInfo = rawToken
            });
            PassiveAuthActivity.getInstance().Finish();
        }
Ejemplo n.º 3
0
        public override void OnPageFinished(WebView view, string url)
        {
            base.OnPageFinished(view, url);
            var payload = view.Title;

            if (payload.Contains("Success payload="))
            {
                view.LoadUrl(GET_TITLE_FN);
            }
            else if (payload.Contains("Error message="))
            {
                AuthenticationEventManager.OnAuthenticationResponseArrived(new AuthenticationResponseEventArgs {
                    Success      = false,
                    ErrorMessage = payload.Replace("Error message=", String.Empty)
                });
                //TODO: display alert with error
            }
        }