Add SSO using auth_pubtkt for 3 web apps

- Install mod_auth_pubtkt and generate public/private key-pair.

- Redirect user to login page if no cookie is presented.

- Add check for authenticated user for login page.

- Temporarily switched to DSA because of a bug in mod_auth_pubtkt
  which causes it to accept only DSA and not RSA. Also had to use SHA1
  instead of SHA256.

- Enabled SSO for Syncthing, Repro and TT-RSS.

- Using tokens to authorize by user groups.

- Generate keys during first boot.
This commit is contained in:
Joseph Nuthalpati authored and James Valleroy committed 2017-06-03 10:29:42 -04:00
1 parent 0cc8d3ec1d
commit 995365f3df
15 files changed
+324 -17

No files matched your search

+1 -1
View File
@@ -38,7 +38,7 @@ first_boot_steps = [
{
'id': 'users_firstboot',
'url': 'users:firstboot',
'order': 1
'order': 2
},
]
+6 -4
View File
@@ -20,11 +20,14 @@ URLs for the Users module
"""
from django.conf.urls import url
from django.contrib.auth import views as auth_views
from django.urls import reverse_lazy
from stronghold.decorators import public
from plinth.utils import non_admin_view
from plinth.modules.sso.views import (
login as sso_login,
logout as sso_logout
)
from . import views
@@ -39,9 +42,8 @@ urlpatterns = [
non_admin_view(views.UserChangePassword.as_view()),
name='change_password'),
# Add Django's login/logout urls
url(r'^accounts/login/$', public(auth_views.login),
{'template_name': 'login.html'}, name='login'),
url(r'^accounts/logout/$', public(auth_views.logout),
url(r'^accounts/login/$', public(sso_login), name='login'),
url(r'^accounts/logout/$', public(sso_logout),
{'next_page': reverse_lazy('index')}, name='logout'),
url(r'^users/firstboot/$', public(views.FirstBootView.as_view()),
name='firstboot'),