Giter Club home page Giter Club logo

zenfusionoauth's Introduction

ZenFusion OAuth

This module provides Google APIs OAuth 2 authentication client capabilities to Dolibarr.

It is designed to be used with other ZenFusion modules.

License

Copyright (C) 2011-2016 GPC.solutions

GPLv3 or (at your option) any later version.

See COPYING for more information.

Composer

This project uses composer to manage external dependencies.

Please see https://getcomposer.org for more informations.

First use

Please issue the following command at the project root after clone to install required dependencies:

  • Production: composer install --no-dev
  • Development: composer install

Updates

After pulling, use composer update to update the dependencies.

zenfusionoauth's People

Contributors

csalvador avatar rdoursenaud avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

nhatdoan

zenfusionoauth's Issues

Handle invalid grant

Deactivate token and redirect user to authentication page.

Sample error:

Error refreshing the OAuth2 token, message: '{
  "error" : "invalid_grant",
  "error_description" : "Token has been revoked."
}'

Improve UX when no other ZenFusion module is available

This module is a technical dependency to other modules and don't offer any user feature by itself.
It's built as a module so that the code can be shared amongst other modules.

When installed without any other modules, it issues a "NoScope" error that is not very helpful in understanding the problem.
Improve the message by providing to the user the information that he needs to install at least one other module from the ZenFusion family.

Marketplace application

After implementing #15, we can implement a workflow similar to the single user workflow but for Google Apps domains using a (dummy) marketplace application.
Again, explore the possibilities of this technology and draft a feature.

Better scope support

Find a way to display available and active scopes in a human friendly way.

Tentative features:

  • Allow to choose which service(s) we want.
  • Suggest new available scopes when a new ZenFusion module is installed.

Take user status into account

Dolibarr users can be disabled.

  • Token and API access should be revoked on user disable
  • Disabled users should not be listed on the frontpage status box
  • Google user tab should be deactivated and page blocked for disabled users so that communication can't be reestablished (i.e. by an admin)

Something weird

When Zenfusion_Oauth2Client.class.php is included (before call), the $object->datef in trigger was modified. (in my case 27/03 become 26/03). I try to investigated but loose the way in this file :/

Allow using a domain OAuth master token

Google Apps for Business allows using master tokens from the domain rather than individual tokens.
Explore the possibilities of this technology and draft a feature.

Better error handling

Errors should be properly catched.

Here's an exemple a client got faced with :
Fatal error: Uncaught exception 'Google_Auth_Exception' with message 'Error refreshing the OAuth2 token, message: '{ "error" : "invalid_client", "error_description" : "The OAuth client was deleted." }'' in /home/doozo/www/dolibarr/htdocs/custom/zenfusionoauth/lib/google-api-php-client/src/Google/Auth/OAuth2.php:327 Stack trace: #0 /home/doozo/www/dolibarr/htdocs/custom/zenfusionoauth/lib/google-api-php-client/src/Google/Auth/OAuth2.php(254): Google_Auth_OAuth2->refreshTokenRequest(Array) #1 /home/doozo/www/dolibarr/htdocs/custom/zenfusionoauth/lib/google-api-php-client/src/Google/Client.php(364): Google_Auth_OAuth2->refreshToken('1/DGtyBK9SIFEqw...') #2 /home/doozo/www/dolibarr/htdocs/custom/zenfusionoauth/lib/tokens.lib.php(123): Google_Client->refreshToken('1/DGtyBK9SIFEqw...') #3 /home/doozo/www/dolibarr/htdocs/custom/zenfusionoauth/lib/tokens.lib.php(96): refreshTokenIfExpired(Object(stdClass)) #4 /home/doozo/www/dolibarr/htdocs/custom/zenfusiondrive/class/actions_zenfusiondrive.class.php(57): getToken(Object(Doli in /home/doozo/www/dolibarr/htdocs/custom/zenfusionoauth/lib/google-api-php-client/src/Google/Auth/OAuth2.php on line 327

Translations do not use fallback language

If accessed with a language other than US English or French, the instructions page displays the translation tokens not actual text making it unusable.
Find a way to fallback to US English when translations are unavailable.

Dolibarr 3.9 compatibility (incompatible showBox declaration)

2015/11/03 08:14:54 [error] 1038#0: *69 FastCGI sent in stderr: "PHP message: PHP Warning:  Declaration of OauthStatus::showBox() should be compatible with ModeleBoxes::showBox($head, $contents) in /home/rdoursenaud/Documents/gpcsrc/dolibarr/htdocs/custom/zenfusionoauth/core/boxes/OauthStatus.php on line 38
PHP message: PHP Stack trace:
PHP message: PHP   1. {main}() /home/rdoursenaud/Documents/gpcsrc/dolibarr/htdocs/index.php:0
PHP message: PHP   2. FormOther::printBoxesArea() /home/rdoursenaud/Documents/gpcsrc/dolibarr/htdocs/index.php:486
PHP message: PHP   3. InfoBox::listBoxes() /home/rdoursenaud/Documents/gpcsrc/dolibarr/htdocs/core/class/html.formother.class.php:976
PHP message: PHP   4. dol_include_once() /home/rdoursenaud/Documents/gpcsrc/dolibarr/htdocs/core/class/infobox.class.php:106
PHP message: PHP   5. include_once() /home/rdoursenaud/Documents/gpcsrc/dolibarr/htdocs/core/lib/functions.lib.php:322" while reading upstream, client: ::1, server: dev.zenfusion.fr, request: "POST /index.php?mainmenu=home HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/php-fpm.sock:", host: "dev.zenfusion.fr", referrer: "https://dev.zenfusion.fr/index.php"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.