Skip to content

donbowman/taiga-contrib-google-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Taiga contrib google auth

A Taiga plugin for google oauth2 authentication (Ported from official gitlab auth).

Installation

Production env

Taiga Back

In your Taiga back python virtualenv install the pip package taiga-contrib-google-auth with:

  pip install taiga-contrib-google-auth

Modify your settings/local.py and include the line:

    INSTALLED_APPS += ["taiga_contrib_google_auth"]

    # Get these from https://console.cloud.google.com/apis/credentials

    GOOGLE_API_CLIENT_ID = env("GOOGLE_API_CLIENT_ID")
    GOOGLE_API_CLIENT_SECRET = env("GOOGLE_API_CLIENT_SECRET")
    GOOGLE_API_REDIRECT_URI = env("GOOGLE_API_REDIRECT_URI")
    GOOGLE_RESTRICT_LOGIN = [env("GOOGLE_RESTRICT_LOGIN")]
    GOOGLE_API_ALLOW_DOMAIN = [env("GOOGLE_API_ALLOW_DOMAIN")]

Taiga Front

Download in your dist/plugins/ directory of Taiga front the taiga-contrib-google-auth compiled code:

  cd dist/
  mkdir -p plugins/google-auth
  cd plugins/google-auth
  (clone front/dist dir here)

Include in your dist/conf.json in the 'contribPlugins' list the value "/plugins/google-auth/google-auth.json":

...
    "googleClientId": "YOUR-GOOGLE-CLIENT-ID",
    "contribPlugins": [
        (...)
        "/plugins/google-auth/google-auth.json"
    ]
...

Dev env

Taiga Back

Clone the repo and

  cd taiga-contrib-google-auth/back
  workon taiga
  pip install -e .

Modify taiga-back/settings/local.py and include the line:

    INSTALLED_APPS += ["taiga_contrib_google_auth"]

    # Get these from https://console.cloud.google.com/apis/credentials

    GOOGLE_API_CLIENT_ID = env("GOOGLE_API_CLIENT_ID")
    GOOGLE_API_CLIENT_SECRET = env("GOOGLE_API_CLIENT_SECRET")
    GOOGLE_API_REDIRECT_URI = env("GOOGLE_API_REDIRECT_URI")
    GOOGLE_RESTRICT_LOGIN = [env("GOOGLE_RESTRICT_LOGIN")]
    GOOGLE_API_ALLOW_DOMAIN = [env("GOOGLE_API_ALLOW_DOMAIN")]

Taiga Front

After clone the repo link dist in taiga-front plugins directory:

  cd taiga-front/dist
  mkdir -p plugins
  cd plugins
  ln -s ../../../taiga-contrib-google-auth/front/dist google-auth

Include in your dist/conf.json in the 'contribPlugins' list the value "/plugins/google-auth/google-auth.json":

...
    "googleClientId": "YOUR-GOOGLE-CLIENT-ID",
    "contribPlugins": [
        (...)
        "/plugins/google-auth/google-auth.json"
    ]
...

In the plugin source dir taiga-contrib-google-auth/front run

npm install

and use:

  • gulp to regenerate the source and watch for changes.
  • gulp build to only regenerate the source.

Running tests

We only have backend tests, you have to add your taiga-back directory to the PYTHONPATH environment variable, and run py.test, for example:

  cd back
  add2virtualenv /home/taiga/taiga-back/
  py.test

About

Integrate login of Taiga with Google OAUTH2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors