Skip to content

prrvchr/OAuth2OOo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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

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.


CASA certification:

In order to provide you with interoperability with Google, the OAuth2OOo extension requires CASA certification.
Until now, this certification was free and carried out by a Google partner.
The OAuth2OOo application obtained its CASA certification on 11/28/2023.

Now this certification has become paid and costs $600.

I never anticipated such costs and I am counting on your contribution to finance this certification.

Thank you for your help. Sponsor


Requirement:

The minimum version of LibreOffice supported by the OAuth2OOo extension depends on how you installed LibreOffice on your computer:

  • Regardless of platform, if you installed LibreOffice from the LibreOffice download site, the minimum version of LibreOffice is 7.0.

  • On Linux, if you used the package manager to install LibreOffice, the minimum version of LibreOffice is 6.0. However, you must ensure that the system-provided Python version is not lower than 3.8.
    In addition, your system-provided Python packages can be out of date. The extension's logging will allow you to check if this is the case. It is accessible via the menu: Tools -> Options -> Internet -> OAuth2 protocol -> View log -> System Info and requires restarting LibreOffice after activation.
    If outdated packages appear, you can update them with this procedure:

    • Download the file requirements.txt.
    • Install using pip, the Python packages necessary for the extension with the command:
      pip install requirements.txt

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.

  • On Windows to ensure that LibreOffice restarts correctly, use Windows Task Manager to verify that no LibreOffice services are visible after LibreOffice shuts down (and kill it if so).
  • Under Linux or macOS you can also ensure that LibreOffice restarts correctly, by launching it from a terminal with the command soffice and using the key combination Ctrl + C if after stopping LibreOffice, the terminal is not active (no command prompt).

Use:

This extension was originally designed to provide OAuth2 protocol support to other LibreOffice extensions.
It also provides an API usable in BASIC to make HTTP requests:

Create the UNO OAuth2Service with the OAuth2 protocol support:

sUser = "[email protected]"
sUrl = "people.googleapis.com"
oRequest = createUnoServiceWithArguments("io.github.prrvchr.OAuth2OOo.OAuth2Service", Array(sUrl, sUser))

Create the UNO OAuth2Service without the OAuth2 protocol support:

oRequest = createUnoServiceWithArguments("io.github.prrvchr.OAuth2OOo.OAuth2Service")

Use the UNO OAuth2Service to perform HTTP requests:

You now have an oRequest object that responds to the interface defined in the XOAuth2Service.idl file.
With this interface, two methods are required to execute an HTTP request:

  • getRequestParameter([in] string Name), which allows you to obtain an object responding to the XRequestParameter.idl interface. This interface allows you to configure the HTTP request before execution.
  • execute([in] com::sun::star::rest::XRequestParameter Parameter), which allows you to obtain an object responding to the XRequestResponse.idl interface. This allows you to achieve almost anything possible with an HTTP response.

To go further, I advise you to take a look at the macros that are delivered with the extension and which implement all types of HTTP requests.


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.


How to build the extension:

Normally, the extension is created with Eclipse for Java and LOEclipse. To work around Eclipse, I modified LOEclipse to allow the extension to be created with Apache Ant.
To create the OAuth2OOo extension with the help of Apache Ant, you need to:

  • Install the Java SDK version 17 or higher.
  • Install Apache Ant version 1.10.0 or higher.
  • Install LibreOffice and its SDK version 7.x or higher.
  • Clone the OAuth2OOo repository on GitHub into a folder.
  • From this folder, move to the directory: source/OAuth2OOo/
  • In this directory, edit the file: build.properties so that the office.install.dir and sdk.dir properties point to the folders where LibreOffice and its SDK were installed, respectively.
  • Start the archive creation process using the command: ant
  • You will find the generated archive in the subfolder: dist/

Has been tested with:

  • LibreOffice 7.3.7.2 - Lubuntu 22.04 - Python version 3.10.12

  • LibreOffice 7.5.4.2(x86) - Windows 10 - Python version 3.8.16 (under Lubuntu 22.04 / VirtualBox 6.1.38)

  • LibreOffice 7.4.3.2(x64) - Windows 10(x64) - Python version 3.8.15 (under Lubuntu 22.04 / VirtualBox 6.1.38)

  • LibreOffice 24.8.0.3 (x86_64) - Windows 10(x64) - Python version 3.9.19 (under Lubuntu 22.04 / VirtualBox 6.1.38)

  • Does not work with OpenOffice see bug 128569. Having no solution, I encourage you to install LibreOffice.

I encourage you in case of problem πŸ˜•
to create an issue
I will try to solve it πŸ˜„


Historical:

Sponsor this project

 

Packages

No packages published

Contributors 2

  •  
  •