Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2016-08

Google API, OAuth2 and Windows

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Lubos Pintes

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.
Thanks.

Michael Van Canneyt
to Lubos Pintes
Lubos Pintes wrote 8 lines
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.