Repository navigation
v1.13.0
·
1 commit
to refs/heads/master
since this release
Requirements
- Python 3.10–3.13 (
python_requiresis>=3.10). - Django 5.2 from 5.2.17, Django 6.0 from 6.0.8, and Django 6.1 from 6.1.1.
- pysaml2
>=7.5.5, cryptography>=50.0.0, pyopenssl>=26.4.0, defusedxml>=0.4.1.
Security
- The dependency floor fixes all the known CVEs.
- The built wheel keeps
djangosaml2/tests, keys, and generated HTML out of the package.
Content Security Policy
- Django 6
ContentSecurityPolicyMiddlewareis used whendjango-cspis not installed (#431). - The login and logout POST forms stringify
csp_noncebefore the template tests it, so a lazy nonce still renders. - The logout autosubmit script receives that nonce.
Authentication request
- The HTTP-POST path passes
sign_algtocreate_authn_request(#432). - The setup guide documents
requested_attributesand a customExtensionsobject onsso_kwargs.
Logout
- A logout with no SAML subject ends the Django session and redirects.
global_logoutis not called withNone. - The redirect that finishes a logout POST is
303 See Other. - Logout failures are covered: ignored errors, a failed status,
LogoutError, an unsupported binding, an empty result, an unknown binding, and a logout service call that carries neitherSAMLRequestnorSAMLResponse.
Users
SAML_USER_MODELselects the user model.set_unusable_passwordruns only when that model defines it.get_or_create_userusesget_user_query. Adictis a field lookup. AQobject is passed toobjects.get.pre_user_save,post_user_save,authenticate, andpost_authenticatedare sent withsend_robust. A receiver exception is logged and login continues. A subclass that replacespost_login_hookcallssuper()to keeppost_authenticated.
Documentation
saml2/logout/starts logout.saml2/ls/is the single logout the identity provider calls.saml2/ls/post/is the HTTP-POST binding.saml2/metadata/returns the service provider metadata.- The page after login reads attributes from the SAML session through
EchoAttributesView. post_login_hook(request, user, session_info)is whererequest.siteis available.session_info['ava']holds the assertion attributes.SAML_CONFIG_LOADERreceives the request and returns theSPConfigfor that tenant.- The
idpquery parameter selects the recipient when the metadata lists more than one identity provider.available_idpsreads that list from the metadata. Theservice.sp.idpdictionary is not that list. scopingplaces oneIDPEntryin the authentication request.required_attributesis published in metadata asRequestedAttribute isRequired="true".NAMEID_FORMAT_EMAILADDRESSrequests an email subject.
Full Changelog: v1.12.0-1...v1.13.0