简体   繁体   中英

Google Oauth2 Consent Screen "Allow" button disabled for DELPHI app

Can someone please help me why the button "Allow" in the screen below is disabled? WE are using a Delphi application in order to have user single sign on with google using the TWebBrowser built in delphi to start the process. Here is what our payload looks like: (Is there a way to bypass this check? maybe send other parameters to the url request? or other ideas how can we authenticate google using the client_id..etc. ) We have been reading similar posts in Stackoverflow, but no solutions. Thanks

https://accounts.google.com/o/oauth2/auth?
client_id=1000217514248-pqeu5oqj3easr************************&
redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob
&response_type=code&
state=995F6663-D8FE-4***************&
scope=openid+email
&code_challenge=0C336C62-1B4E-49F7-*************&
login_hint=test%40test.be
&hd=test.be&
as=S-737348098%3A1615472*****6&flowName=GeneralOAuthFlow

在此处输入图像描述

You need to make sure that you are opening the browser window on the users installed browser.

You cant open the consent screen from any type of embeded browser or iframe. You need to open a new window in the users installed browser

I had that same problem before. Google is detecting an old and insecure browser and will not allow the authorization to proceed.

I ended up creating a TCustomAuthenticator descendent class for this. This should work on older versions of Delphi.

It implements a OAuth2 Authenticator:

  • Allows authorization via externel browser
  • Uses PKCE flow for added security
  • Generates new tokens when they expire (using the refresh token)

In the repository there's a Demo app too.

Feel free to use it if you like: https://github.com/imperyal/delphi-google-oauth2

We stopped using embedded browsers...we used the common Google services in order to have the pop up from default browser in order to login. The current DELPHI version uses Internet Explorer 11 as internal browser, i believe that New versions of delphi have Edge as internal browser which this will not have the disabled button on.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM