Overview
I wish to collect the contents of a browser's address bar opened by a function in a program in C / C++. There are a few threads here which discuss the matter. However, none seems to be helpful to me.
My environment
OS : Windows 7, Windows 10.
Development language : C / C++
My project
I am writing an app in which I need to collect data from a server. The server requires the client to authenticate itself and uses the 2-step OAuth 2.0 protocol for that. I need to make use of a web API developed by a third party.
The following page describes the whole process.
https://apidocs.getresponse.com/v3/case-study/oauth2-authorization-code
However, I only have a problem with the first step : obtain an authorization code from the server.
A highlight from this page explains the process for the first step, the only one that matters here :
Want to see by yourself ? Try this.
I have created an account and registered a bogus app on getresponse.com for testing purpose.
Navigate to the following URL :
Login with :
Your email : jnj54972@cuoly.com
Password : @Aa11111On the next screen, Click Yes.
After redirection to the example.com site, the next screen shows the following in the address bar :
http://example.com/receiver?code=<code>&state=xyz
This code in the address bar is precisely what I need to continue with the second step of the authentication when this page is displayed in the browser. Hence the necessity to collect the data contained in the address bar.
- You can repeat the operation and navigate again to the same URL: you will not have to login again, and you will obtain another authorization code.
(Note : To test the Oauth 2.0 protocol on getresponse.com, I created an app on 9 July 2020. This account has a validity of 30 days. Therefore, the login credentials mentioned above are likely to expire a month after the date of creation.)
What I have tried so far
I won't go in details or this post may get too long. But I did try numerous 'curl GET' requests with various parameters. No luck : I never get the browser's address bar data with the code in return.
Can someone help ?