Search code examples
pythondjangogoogle-oauthkiwi-tcms

Google OAuth2 integration with kiwi tcms


I have followed exact steps on the documentation provided to integrate google OAuth2.

From Kiwi github page.

Google sign-in details. https://python-social-auth.readthedocs.io/en/latest/backends/google.html#google-sign-in

I have included relevant settings in /tcms/settings/common.py

AUTHENTICATION_BACKENDS = [
     "django.contrib.auth.backends.ModelBackend",
     "guardian.backends.ObjectPermissionBackend",
     "social_core.backends.google.GooglePlusAuth",
 ]
 
SOCIAL_AUTH_GOOGLE_PLUS_KEY = "XXXXXXX-XXXXXXXX.apps.googleusercontent.com"
SOCIAL_AUTH_GOOGLE_PLUS_SECRET = "XXXXXXXXXXXXXXXXXXXXX"

With above configuration, i am able to runserver and get to localhost page. The UI page doesn't contain expected way of sign in via SSO. Am i missing something? How to get the changes in the kiwi tcms UI like https://public.tenant.kiwitcms.org/accounts/login/?next=/ Or Continue With Google section of sign in.


Solution

  • Well, the question is vague in some terms to expect UI changes without changing the templates.

    I had to add appropriate custom login block at this location.

    https://github.com/kiwitcms/Kiwi/blob/master/tcms/templates/registration/login.html#L39

    It needed few updates in the settings, similar to this project