-
3 django projects.
- Server:
sso_server
- Client1:
client1
- Client2:
client2
- Server:
-
python3 -m venv env
-
source env/bin/activate
-
pip install -r requirements.txt
sudo nano /etc/hosts
127.0.0.1 server.app.com
127.0.0.1 client1.app.com
127.0.0.1 client2.app.com
ctrl + o
-> Save.
-
Server:
cd sso_server & python manage.py migrate
-
Client1:
cd client1 & python manage.py migrate
-
Client2:
cd client2 & python manage.py migrate
-
Servere:
cd sso_server & python manage.py runserver server.app.com:8000
-
Client1:
cd client1 & python manage.py runserver client1.app.com:8001
-
Client2:
cd client2 & python manage.py runserver client2.app.com:8002
-
Super User:
cd sso_server & python manage.py createsuperuser
-
Login:
http://server.app.com:8000/admin
-
This url tells client, where to redirect the current context for authentication.
-
client1/client1/settings.py
andclient2/client2/settings.py
SSO_SERVER=http://server.app.com:8000/server/
-
Create consumer for client1 and client2.
-
Use those two private and public keys thus obtained at
client1/client1/settings.py
andclient2/client2/settings.py
SSO_PRIVATE_KEY=<PRIVATE_KEY>
SSO_PUBLIC_KEY =<PUBLIC_KEY>