function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jane JaniszewskiJane Janiszewski 

How do you get the access code from the redirect URI in web server authentication flow using c#?

I am fairly new at creating web requests and using REST API to pass data back and forth.
Does anyone have any suggestions on how to implement the Web-Server authentication flow so that my application redirects to the login page, and then is able to get the access code from the redirect uri? I have found some ideas, for example creating an embedded web browser or creating a web service, but I am not sure how to implement these. 

I understand how to make the initial request, passing the clientID, clientSecret and redirectURI into the request. I successfully obtain an HTML script as a response, which includes the url used to login at salesforce. I am not understanding the part where the app opens a browser for the user to login to, and then where the app is able to pull the access code from the redirected page's URI. 
I implemented Process.Start(loginUrl), which successfully opens up a browser page at the right login page, but this method makes it very difficult to get the access code out to the redirect uri.

Thanks!