OAuth2OOo logo Documentation

Ce document en français.

The use of this software subjects you to our Terms Of Use and Data Protection Policy.

version 1.3.3

Introduction:

OAuth2OOo is part of a Suite of LibreOffice and/or OpenOffice extensions allowing to offer you innovative services in these office suites.

This extension is the implementation of the OAuth 2.0 protocol. Protocol allowing you to obtain your consent so that an application can access your data present at the GAFA.

It allows executing HTTP requests in BASIC and provides the following macros as an example:

If you open a document beforehand, you can launch them by:
Tools -> Macros -> Run Macro… -> My Macros -> OAuth2OOo -> macro-name -> Main -> Run

It also allows grabbing internet data in a Calc sheet. See the following Calc files as an example:

And finally, it allows you to drive Firefox using a Calc file (or any other browser supported by Selenium). See the following files:

Being free software I encourage you:

In short, to participate in the development of this extension. Because it is together that we can make Free Software smarter.


Requirement:

In order to take advantage of the latest versions of the Python libraries used in OAuth2OOo, version 2 of Python has been abandoned in favor of Python 3.8 minimum.
This means that OAuth2OOo no longer supports OpenOffice and LibreOffice 6.x on Windows since version 1.1.0. I can only advise you to migrate to LibreOffice 7.x.

The requirement depend on the platform (architecture) on which the extension is installed:

On Linux and macOS the packages used by the extension, if already installed, may come from the system and therefore may not be up to date.
To ensure that your Python packages are up to date it is recommended to use the System Info option in the extension Options accessible by:
Tools -> Options -> Internet -> OAuth2 protocol -> View log -> System Info
If outdated packages appear, you can update them with the command:
pip install --upgrade <package-name>

For more information see: What has been done for version 1.3.0.

If you want to drive Firefox in Calc on Ubuntu then you need to reinstall Firefox from the Mozilla PPA.
To install the Mozilla PPA please type the command:
sudo add-apt-repository ppa:mozillateam/ppa


Installation:

It seems important that the file was not renamed when it was downloaded.
If necessary, rename it before installing it.

Restart LibreOffice after installation.
Be careful, restarting LibreOffice may not be enough.


Use:

This extension is not made to be used alone, but provide OAuth2 service to other LibreOffice / OpenOffice extensions.
Here’s how we use its API:

Create OAuth2 service:

identifier = “io.github.prrvchr.OAuth2OOo.OAuth2Service”
service = ctx.ServiceManager.createInstanceWithContext(identifier, ctx)

Initialize Session or at least Url:

initialized = service.initializeSession(registered_url, user_account)

The return value: initialized is True if user_account is already authorized for registered_url.

initialized = service.initializeUrl(registered_url)

The return value: initialized is True if registered_url was successfully found in the OAuth2 service configuration.

Get the access token:

format = ‘Bearer %s’
token = service.getToken(format)


Uno OAuth2.0 API for LibreOffice.

OAuth2OOo Wizard Page1 screenshot

OAuth2OOo Wizard Page2 screenshot

OAuth2OOo Wizard Page3 screenshot

OAuth2OOo Browser Page1 screenshot

OAuth2OOo Browser Page2 screenshot

OAuth2OOo Browser Page3 screenshot

OAuth2OOo Browser Page4 screenshot

OAuth2OOo Wizard Page4 screenshot

The OAuth2 protocol allows access to server resources, after accepting the connection authorization, by exchanging tokens.

The revocation takes place in the management of the applications associated with your account.

No more password is stored in LibreOffice.


Has been tested with:

I encourage you in case of problem :confused:
to create an issue
I will try to solve it :smile:


Historical:

What has been done for version 0.0.5:

What has been done for version 0.0.6:

What has been done for version 1.0.0:

This makes HTTP requests using JSON easily usable in the BASIC language of LibreOffice.

What has been done for version 1.0.1:

What has been done for version 1.1.0:

What has been done for version 1.1.1:

What has been done for version 1.1.2:

What has been done for version 1.2.0:

What has been done for version 1.2.1:

What has been done for version 1.2.2:

What has been done for version 1.2.3:

What has been done for version 1.2.4:

What has been done for version 1.3.0:

What has been done for version 1.3.1:

What has been done for version 1.3.2:

What has been done for version 1.3.3:

What remains to be done for version 1.3.3: