django-sso-ui
Sebuah library python untuk memudahkan aplikasi django menggunakan SSO Universitas Indonesia.
Instalasi
pip install django-sso-ui
Cara Menggunakan
Pertama import decorator with_sso_ui
from django_sso_ui.decorators import with_sso_ui
Lalu wrap ke view yang membutuhkan info user sso ui. Jangan lupa tambahkan parameter sso_profile pada fungsi view yang di wrap.
@with_sso_ui
def login(request, sso_profile):
return HttpResponse(json.dumps(sso_profile))
Apabila pengguna tidak diharuskan login dengan SSO untuk mengakses view tersebut, tambahkan parameter force_login=False pada decorator.
@with_sso_ui(force_login=False)
def login(request, sso_profile):
return HttpResponse(json.dumps(sso_profile))
Settings
Untuk mengubah endpoint cas yang digunakan, terdapat opsi di tambahkan
line berikut di settings.py dengan endpoint yang diinginkan
SSO_UI_URL="https://sso.ui.ac.id/cas2/"
Untuk memaksa library untuk menggunakan https untuk url callback setelah
login CAS berhasil, tambahkan line berikut di settings.py
SSO_UI_FORCE_SERVICE_HTTPS=True
Notes
Informasi tambahan seperti fakultas, study_program hanya bisa didapatkan
apabila menggunakan https://sso.ui.ac.id/cas2.
Metadata
Release files for django-sso-ui 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_sso_ui-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / django_sso_ui-1.0.0-py3-none-any.whl
| Download URL | django_sso_ui-1.0.0-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bec33a8dc6c77ce2ae5096f0ff292a9605404ce596f76c4140bcb3e22f981f71
|
|
BLAKE2b-256 checksum How to use checksums |
aa080e52b1d936232882cea7a3a6b62f5b4e1932cfc3dc98c7e928f43b6526d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8
|