Reputation: 6154
I need to access some web api from my desktop application for authentication. For example, facebook api, it requires to redirect to facebook page for allow permission from user and then it redirect back along with an access token which is needed for accessing private data. Now, on facebook documentation they alreasy metioned that, webbrowser class of .NET framework can help in this case. THere are two webbrowser class, one for wpf application, at msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.aspx, another is for windows forms application, at msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx
Now, My question is, how can i use this to make a broser like popup of the url and after it back , retrieve the url again.
Regards
Upvotes: 1
Views: 873
Reputation: 25287
Well, I will list the steps for you, and it's easier that you may think:
Form
that will be used to house the WebBrowser
control and style it to look like a popup.Navigate()
method on the WebBrowser to go to the needed URLUrl
property on the WebBrowser and get the token (Hint: you can use the Navigated
event to determine when the page is (re)loading.)Upvotes: 1