[fpc-pascal] Google API, OAuth2 and Windows

Michael Van Canneyt michael at freepascal.org
Fri Aug 5 21:54:35 CEST 2016



On Fri, 5 Aug 2016, Lubos Pintes wrote:

> Hello,
> I want to use Google Calendar API with FPC 3.0.0 under Windows. I grabbed 
> necessary units from SVN, because it seems to me that they are not available 
> under FPC 3.0.0 units.
> My question: how can I handle OAuth2? Do I need an external library like 
> Synapse under Windows, or can I use existing units from FPC 3.0.0?
> I noticed that there are units like fpoauth2, but I have no idea how to use 
> them.

The OAuth2 implementation does not depend on a particular transport class.
It assumes a TFPWebclient instance (one exists for FPC httpclient, and for
synapse)

The TOAuth2Handler class "signs" a request made with TFPWebclient. 
For this it may send additional HTTP(s) requests to handle the OAuth2 token flow.

You can see this in action in the OData examples and in the google api
examples.


Michael.



More information about the fpc-pascal mailing list