M
MrSnert
Guest
I have an application. It's job is to handle the OAuth journey between a client app and the authenticating server. One of the first things I need to do is get the auth code from the server. The basic code is:
var http = new HttpListener();
http.Prefixes.Add(appSettings.RedirectUrl);
http.Start();
System.Diagnostics.Process.Start(url);
var context = http.GetContext();
So once the process starts it opens the web page and it will sit there and wait until the user has logged into the website, granted authority, and it redirects. From which point the last line above picks up the context and off it goes and continues. However, if the user doesn't not complete the OAuth journey, say they close the browser window, the application sits and waits forever more waiting.
What can I do to stop this process from hanging? If the user doesn't complete the OAuth journey, I need to be able to get out of this wait.
Continue reading...
var http = new HttpListener();
http.Prefixes.Add(appSettings.RedirectUrl);
http.Start();
System.Diagnostics.Process.Start(url);
var context = http.GetContext();
So once the process starts it opens the web page and it will sit there and wait until the user has logged into the website, granted authority, and it redirects. From which point the last line above picks up the context and off it goes and continues. However, if the user doesn't not complete the OAuth journey, say they close the browser window, the application sits and waits forever more waiting.
What can I do to stop this process from hanging? If the user doesn't complete the OAuth journey, I need to be able to get out of this wait.
Continue reading...