Exemple #1
0
        public async Task AuthenticationWithBrowserAsync()
        {
            try
            {
                // Generate and send auth request to safe-browser for authentication.
                Console.WriteLine("Requesting authentication from Safe browser");
                var encodedReq = await AuthHelpers.GenerateEncodedAppRequestAsync(_appInfo);

                var url  = AuthHelpers.UrlFormat(_appInfo, encodedReq.Item2, true);
                var info = new System.Diagnostics.ProcessStartInfo
                {
                    UseShellExecute = true, // not default in netcore, so needs to be set
                    FileName        = url
                };
                System.Diagnostics.Process.Start(info);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Exception: " + ex.Message);
                throw ex;
            }
        }