Note that there are some explanatory texts on larger screens.

plurals
  1. POImplementation of sso with django auth. Is this safe?
    primarykey
    data
    text
    <p>I'm trying to implement single sign-on using only django auth.</p> <p>Let's assume two django projects, on different sub-domains: site.com(auth) and app1.site.com(app1) The auth table in site.com is master. site.com handles: login, logout, account registration, etc.</p> <p>site.com sets SESSION_COOKIE_DOMAIN to .site.com to allow it to be read by subdomains</p> <p>app1 will have login_url set to a view in the app1 project, which does the following:</p> <ul> <li>retrieves site.com's session_id value(from cookie)</li> <li>validates session_id by making a request to: site.com/validate/[session_id]/</li> <li>If False, redirects to site.com/login?next=[...]</li> <li>If True, request user data to: site.com/attributes/[session_id]/</li> <li>site.com/attributes/ delivers a dictionary with all the User values, encrypted using a shared SSO_KEY(encryption done the same way django encodes and decodes session_id)</li> </ul> <p>Now, app1 has a model SSO_User which has two fields, a foreign key to User model and an integer field. The SSO_User models links local auth User to the id of master auth table.</p> <p>Using the id retrieved from site.com, we check SSO_User for existing local user, if true we simply update the values and login; if non existing, we create the user and SSO_User and login.</p> <p>app1(or any other sub-domain) can keep their own profile information, without interfering with anything.</p> <p>It seems simple to implement and safe, but before implementing I wanted some opinions. What do you think?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload