- Home /
Question by
farhan3d · Aug 17, 2021 at 02:22 PM ·
c#apiauthentication
How to implement authorization URL opening in browser to get auth code?
I am trying to implement OAuth 2.0 flow for an API, and I would like the authorization URL to be opened in a browser window where I would get consent, and the redirect URL would have the code embedded which I can use later for calling the API.
The code I have is a simple async GET, but it doesn't launch the browser to request for user authorization. Any pointers would be very helpful, thanks!
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(auth_url);
HttpWebResponse response = (HttpWebResponse)(await request.GetResponseAsync());
StreamReader reader = new StreamReader(response.GetResponseStream());
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613041757im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Authenticate steam user ID to avoid "fraud" 1 Answer
Illuminating a 3D object's edges OnMouseOver (script in c#)? 1 Answer
How to use unity scripting api? 2 Answers