0

I am using google oauth 2 for authentication. (Installed application)

Right now when the user allows access in user consent screen, how can i retrieve auth code from the redirect uri without user involving in cut and copy paste auth code. How to read the auth code from the title bar?

Radcliff
  • 45
  • 1
  • 7

3 Answers3

1

In any Operating system a program can read titles from the windows of any other application ( including your browser ).

In order to help you I would need to know what OS you are using and what language you are using to develop your Google declared "Installed Application".

The following thread shows you how to get a list of windows titles in Java

How to get a list of current open windows/process with Java?

Community
  • 1
  • 1
Hotellina
  • 48
  • 1
  • 6
0

For installed application, you can use the special redirect_uri urn:ietf:wg:oauth:2.0:oob, and the authorization code will be returned in the title bar of the browser, your app can read the title of the HTML page to obtain the authorization code.

The tile of page will be like this:Success code=AuthorizationCode

So you can check the webpage, if the title contains this string, you'll get code.

Owen Cao
  • 7,955
  • 2
  • 27
  • 35
  • That is what my question was. How to read the title of the HTML page to obtain the authorization code ? I have searched in many websites but couldn't find any way to read the title using the application. – Radcliff Jul 16 '14 at 05:08
  • What's your OS? Android, ios or others? – Owen Cao Jul 16 '14 at 05:10
  • Others. Actually I am designing a web application. In that If i click a button it should ask for the permission (allow/deny after signing in). Then my application must automatically retrieve access code from the title of the HTML page and make use of it for further processing. – Radcliff Jul 16 '14 at 05:13
  • I must not use localhost redirect URI. Because anyone in my network can access my application. So if i specify localhost then the auth. code will be sent to the localhost of their computer. I dont want this to happen. – Radcliff Jul 16 '14 at 05:14
0

yes .. this can be done by using google service account. they will provide us a p12key and we can make use of it without any consent screen.

Radcliff
  • 45
  • 1
  • 7