protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            var url = await authorizer.GetPinEnterUrl();

            AuthWebView.Navigate(new Uri(url));
            base.OnNavigatedTo(e);
        }
        // public delegate void NavigationEventArgs(object sender, EventArgs e);

        public AuthenticationPage()
        {
            InitializeComponent();
            String url = String.Format(COINBASE_URL, CoinbaseApi.ClientId);

            AuthWebView.Navigate(new Uri(url));
            AuthWebView.Navigated += NavComplete;
        }
Exemplo n.º 3
0
 private void AuthWebView_LoadCompleted(object sender, NavigationEventArgs e)
 {
     if (e.Uri.ToString().IndexOf("access_token=") != -1)
     {
         GetUserToken(e.Uri.ToString());
     }
     else if (e.Uri.ToString() == "https://oauth.vk.com/error?err=2")
     {
         AuthWebView.Navigate(new Uri(""));
     }
 }
        /// <summary>
        /// Handler for the login/click button.
        /// </summary>
        /// <param name="sender">The triggered element.</param>
        /// <param name="e">The triggered event.</param>
        private void LoginButton_Click(object sender, RoutedEventArgs e)
        {
            AuthWebView.Visibility = Visibility.Visible;
            string uri = "https://login.live.com/oauth20_authorize.srf?client_id="
                         + Uri.EscapeDataString((App.Current as App).AppConfig.ClientId)
                         + "&scope="
                         + Uri.EscapeDataString(String.Join(" ", Scopes))
                         + "&response_type=code&redirect_uri="
                         + Uri.EscapeDataString(RedirectUri);

            System.Diagnostics.Debug.WriteLine(uri);
            AuthWebView.Navigate(new Uri(uri));
        }
Exemplo n.º 5
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (!localSettingSwitch.IsOn)
     {
         WebPanel.Visibility = Visibility.Visible;
         Uri uriVKAuth = new Uri("https://oauth.vk.com/authorize?client_id=6044506&display=page&redirect_uri=https://oauth.vk.com/blank.html&scope=friends,messages,photos&response_type=token" + __VKAPI);
         AuthWebView.Navigate(uriVKAuth);
     }
     else
     {
         if (localSettings.Values["main_token"] != null)
         {
             _Token  = localSettings.Values["main_token"].ToString();
             _UserID = localSettings.Values["main_user_id"].ToString();
             Content.Navigate(typeof(MessagesPage), null, new DrillInNavigationTransitionInfo());
         }
     }
 }