Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Google refusing login

User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Google refusing login

Post by salvadordf »

At this moment we don't have a CEF4Delphi demo showing how to authenticate with OAuth.

There seems to be many examples for TWebBrowser when you search "delphi oauth2 twebbrowser example" in google that we could use to create a demo.

I'll try to find some time to do it but it could take some days/weeks because I'm very busy right now. :oops:
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Google refusing login

Post by salvadordf »

This repository has a component to login in google with oauth :
https://github.com/googleapi/googleapi

I haven't tested it and it hasn't been updated in several years but it's promising.
thefunkyjoint
Posts: 458
Joined: Thu Aug 10, 2017 12:40 pm

Re: Google refusing login

Post by thefunkyjoint »

Thanks Salvador, will check it now !
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Google refusing login

Post by salvadordf »

Please, download the latest CEF4Delphi from GitHub.

It has a new OAuth2Tester demo that might be what you need. Read the code comments in that demo because you will need to create some "credentials" in the "Google API Console" to see some results.

That demo uses the system browser to login. When the user has been identified it sends an "access token" used in the REST API requests.

I tried to use that token while navigating to youtube.com or google.com with TChromium but it was ignored by the server and it showed the contents as an unidentified user.
timkieu
Posts: 1
Joined: Tue Jun 15, 2021 11:06 am

Re: Google refusing login

Post by timkieu »

This can bypass simply by using UserAgent string similar to Chromium/Chrome/FireFox/Edge as I tested on CEF for QT, CEF4Delphi all successfully.
This test code on 6/5/2022 is SUCCESSFUL with the FMXTabbedOSRBrowser project. You can check for any Windows CEF4Delphi apps.

Code: Select all

GlobalCEFApp.UserAgent := 'Mozilla/5.0 (Windows NT 10.0; rv:100.0) Gecko/20100101 Firefox/100.0';
NOTE: You should type your Google account and password, do not copy paste.
Last edited by timkieu on Fri May 06, 2022 12:53 am, edited 2 times in total.
Post Reply