By Admin on Friday, 27 May 2022
Category: All

Delphi Google Sign-In Login

​From sgcWebSockets 2022.5.0 there is a new class that simplifies the process of authenticate an user using the Google Account as Authentication. The class let you login with your Google Account in an easy way.

Configuration 

​The module requires first configure your OAuth2 Application in your Google Account, once are configure just add a couple of lines in your application to allow users login with any Google Account.

The Local Server used to read the response from Google, by default listens on IP Address 127.0.0.1 and port 8080. So you must configure the CallBack URL in the Google Application. Of course, you can modify the IP Address and port.

Once configured the OAuth2 Application in the Google Account, just create an instance of TsgcHTTP_OAuth2_Client_Google and call the method Authenticate passing as parameters the Client_Id and Client_Secret. This method waits (by default up to 60 seconds) till the user has login successfully. Returns an object where you can check if the user has authenticated or not, the Name, Id... and more data from the user profile.

Delphi Login Google 

Related Posts