Exemplo n.º 1
0
        private async void WebBrowser_Navigating(object sender, NavigatingCancelEventArgs e)
        {
            var uri = e.Uri;

            if (uri.ToString().StartsWith(OidcClient.Options.RedirectUri))
            {
                var code  = OidcClient.GetCode(uri.Query);
                var token = await _oidcClient.GetTokenAsync(code);

                TokenFile.Write(token);
                this.Close();
            }
        }
Exemplo n.º 2
0
        private async void NameLoginWebView_NavigationStarting(WebView sender, WebViewNavigationStartingEventArgs args)
        {
            var uri = args.Uri;

            if (uri.ToString().StartsWith(OidcClient.Options.RedirectUri))
            {
                var code  = OidcClient.GetCode(uri.Query);
                var token = await this._oidcClient.GetTokenAsync(code);

                await TokenFile.WriteAsync(token);

                if (this.Frame.CanGoBack)
                {
                    this.Frame.GoBack();
                }
            }
        }