Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

PYTHON SELENIUM AUTHOMATION GOOGLE OAUTH 2.0

tommasoBicocchi
7 - Meteor

Hi evryone,

 

I need to "automate" the extraction of data from Google Calendar API;

 

The mechanism of authentication is the OAUTH 2.0, personally I've developed a workflow that:

1- Let the user authenticate on gmail(displaying it a link) to get its first Code;

2- This code will be used into more download tool to extract an access token or a refresh token(with a usage limit).

 

I want to try to automate the first phase using the library Selenium from Python:

- Is it actually possible?(i can insert a Python tool at the beginning of the workflow);

- Is it something that can actually work on the Server(the code will needs to open a browser and replicate authentication behaviour)?

 

Thank you,

T.

 

 

2 REPLIES 2
danilang
19 - Altair
19 - Altair

Hi @tommasoBicocchi 

 

This is a complex problem.  Your first step should be looking at solutions to similar problems.  The first three post from the recommendations above and right, deal with selenium and OAuth and all of them have solutions.

danilang_0-1636817171477.png

Look at how these people solved their problems and try to adapt those solutions to your specific needs.   If you have a specific issue at any step in the process, post the workflow that you have adapted so far and I'm sure that someone here will be able to help you.

 

 

Dan

tommasoBicocchi
7 - Meteor

After some interventions I've solved the problem without the usage of Selenium.

 

For anyone that could be interested, a complete automation of Google API(Calendar, Sheets etc..) usage can be achieved through the setup of a Service Account, then If you want to get any access_token without any login effort by a user:

- using HTTP requests;

- using Python client library;

check that link(https://developers.google.com/identity/protocols/oauth2/service-account).

 

The solution works also on Server environment.

 

 

Labels