README.rst 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. =====================
  2. Misago Single Sign ON
  3. =====================
  4. Client
  5. ======
  6. In Misago instance set settings::
  7. SSO_PRIVATE_KEY = 'MySecretKey'
  8. SSO_PUBLIC_KEY = 'MyPublicKey'
  9. SSO_SERVER = "http://www.example.com/server/"
  10. Server
  11. ======
  12. Example django server instance config:
  13. 1. Install django-simple-sso: ``pip install django-simple-sso``
  14. 2. Run migrations: ``./manage.py migrate``
  15. 3. Create ``Consumer`` object in shell: ``./manage.py shell``::
  16. > from simple_sso.sso_server.models import Consumer
  17. > Consumer.objects.create(public_key='MyPublicKey',
  18. ... private_key='MySecretKey', name='MyAppName')
  19. 4. Add ``'simple_sso.sso_server'`` to ``INSTALLED_APPS``
  20. 5. Initialize server and add urls to ``urls.py``::
  21. from simple_sso.sso_server.server import Server
  22. my_server = Server()
  23. urlpatterns += [
  24. url(r'^server/', include(my_server.get_urls())),
  25. ]
  26. How to test
  27. ===========
  28. In your web browser Go to site ``http://localhost:8000/sso/client/``. You should be redirected to
  29. login on your ``server`` site. After logging you will back to Misago and you will be logged as a
  30. user from ``server`` site.
  31. External docs
  32. =============
  33. Soruce code
  34. -----------
  35. * https://github.com/divio/django-simple-sso
  36. Docs sites
  37. ----------
  38. * https://micropyramid.com/blog/django-single-sign-on-sso-to-multiple-applications/
  39. * https://medium.com/@MicroPyramid/django-single-sign-on-sso-to-multiple-applications-64637da015f4