Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement OAuth2 configuration import in PyQGIS API #59957

Open
florentfgrs opened this issue Dec 18, 2024 · 1 comment
Open

Implement OAuth2 configuration import in PyQGIS API #59957

florentfgrs opened this issue Dec 18, 2024 · 1 comment
Labels
Authentication Related to the QGIS Authentication subsystem or user/password handling Feature Request

Comments

@florentfgrs
Copy link

florentfgrs commented Dec 18, 2024

Feature description

Possibility with QGIS Desktop

In the authentication manager of QGIS Desktop, it is possible to import an OAuth2 configuration with a button.

To do this, you need to:

image

  1. Go to the Authentication tab in the QGIS options window.
  2. Click on the + button to add an authentication method.
  3. Choose the OAuth2 authentication type.
  4. You can then click on an import button.

A window will appear, allowing us to import an OAuth2 config file.

Requested Features

What I would like is to be able to access this import function directly in the PyQGIS API for plugin development.

This import function comes from the QgsAuthOAuth2Edit class, but this class is not available in the PyQGIS API.

I'd like to be able to do a few things like this:

newAU = QgsAuthMethodConfig()
newAU.setId(QgsApplication.authManager().uniqueConfigId())
newAU.setName(“foo”)
newAU.setMethod(“OAuth2”)
newAU.setJsonConfig("my_config_file.json")

Everything is possible in this code except the setJsonConfig method.

Would it be possible to implement the necessary functionality? 🙏

Thank you in advance!

Additional context

No response

@ptitjano ptitjano added the Authentication Related to the QGIS Authentication subsystem or user/password handling label Dec 18, 2024
@Guts
Copy link
Contributor

Guts commented Dec 18, 2024

I guess Isogeo could also be interested in this feature since they manage their authentication through a (Google) conventional client_secrets.json: https://help.isogeo.com/doc-plugin-qgis/en/usage/authentication/

image

cc @SimonSAMPERE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Authentication Related to the QGIS Authentication subsystem or user/password handling Feature Request
Projects
None yet
Development

No branches or pull requests

3 participants