Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
|pypi| |build| |coverage|
See REQUIREMENTS
in the setup.py <https://github.com/divio/django-simple-sso/blob/master/setup.py>
_
file for additional dependencies:
|python| |django|
Terminology
The server is a Django website that holds all the user information and authenticates users.
The client is a Django website that provides login via SSO using the Server. It does not hold any user information.
A unique key identifying a Client. This key can be made public.
A secret key shared between the Server and a single Client. This secret should never be shared with anyone other than the Server and Client and must not be transferred unencrypted.
Workflow
next
GET parameter.Authentication Request
.Requests
All requests have a signature
and key
parameter, see Security.
Client: Python
Target: Server
Method: GET
Extra Parameters: None
Responses:
200
: Everything went fine, the body of the response is a url encoded
query string containing with the request_token
key holding the
Request Token as well as the signature
.400
: Bad request (missing GET parameters)403
: Forbidden (invalid signature)Client: Browser (User)
Target: Server
Method: GET
Extra Parameters:
request_token
Responses:
200
: Everything okay, prompt user to log in or continue.400
: Bad request (missing GET parameter).403
: Forbidden (invalid Request Token).Client: Browser (User)
Target: Client
Method: GET
Extra Parameters:
request_token
: The Request Token returned by the
Request Token Request.auth_token
: The Auth Token generated by the Authorization Request.Responses:
200
: Everything went fine, the user is now logged in.400
: Bad request (missing GET parameters).403
: Forbidden (invalid Request Token).Client: Python
Target: Server
Method: GET
Extra Parameters:
auth_token
: The Auth Token obtained by the Authentication Request.Responses:
200
: Everything went fine, the body of the response is a url encoded
query string containing the user
key which is the JSON serialized
representation of the Django user to create as well as the signature
.Security
Every request is signed using HMAC-SHA256. The signature is in the signature
parameter. The signature message is the urlencoded, alphabetically ordered
query string. The signature key is the Secret of the Client. To verify
the signature the key
paramater holding the key of the Client is
also sent with every request from the Client to the Server.
GET Request with the GET parameters key=bundle123
and the private key
secret key
: fbf6396d0fc40d563e2be3c861f7eb5a1b821b76c2ac943d40a7a63b288619a9
The User object
The User object returned by a successful Auth Token Verification Request does not contain all the information about the Django User, in particular, it does not contain the password.
The user object contains must contain at least the following data:
username
: The unique username of this user.email
: The email of this user.first_name
: The first name of this user, this field is required, but may
be empty.last_name
: The last name of this user, this field is required, but may
be empty.is_staff
: Can this user access the Django admin on the Client?is_superuser
: Does this user have superuser access to the Client?is_active
: Is the user active?Implementation
simple_sso.sso_server
to INSTALLED_APPS
.simple_sso.sso_server.server.Server
and include the return value of the
get_urls
method on that instance into your url patterns.simple_sso.sso_server.models.Consumer
on the
Server.SIMPLE_SSO_SECRET
and SIMPLE_SSO_KEY
settings as provided by
the Server's simple_sso.sso_server.models.Client
model.SIMPLE_SSO_SERVER
setting which is the absolute URL pointing to
the root where the simple_sso.sso_server.urls
where include on the
Server.simple_sso.sso_client.urls
patterns somewhere on the client.Running Tests
You can run tests by executing::
virtualenv env
source env/bin/activate
pip install -r tests/requirements.txt
python setup.py test
.. |pypi| image:: https://badge.fury.io/py/django-simple.sso.svg :target: http://badge.fury.io/py/django-simple.sso .. |build| image:: https://travis-ci.org/divio/django-simple.sso.svg?branch=master :target: https://travis-ci.org/divio/django-simple.sso .. |coverage| image:: https://codecov.io/gh/divio/django-simple.sso/branch/master/graph/badge.svg :target: https://codecov.io/gh/divio/django-simple.sso
.. |python| image:: https://img.shields.io/badge/python-3.5+-blue.svg :target: https://pypi.org/project/django-simple.sso/ .. |django| image:: https://img.shields.io/badge/django-2.2,%203.0,%203.1-blue.svg :target: https://www.djangoproject.com/
FAQs
Simple SSO for Django
We found that django-simple-sso demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.