A Taiga plugin for google oauth2 authentication (Ported from official gitlab auth).
In your Taiga back python virtualenv install the pip package taiga-contrib-google-auth with:
pip install taiga-contrib-google-authModify 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")]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"
]
...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")]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-authInclude 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 installand use:
gulpto regenerate the source and watch for changes.gulp buildto only regenerate the source.
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