Repository navigation
docs(security): consolidate deployment and integration guidance #597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -542,7 +542,23 @@ Starting Login | |
| -------------- | ||
|
|
||
| The ``social:begin`` view requires a ``POST`` request. Use a form and include | ||
| the CSRF token in templates that start authentication. | ||
| the CSRF token in templates that start authentication. The disconnection view | ||
| likewise requires an authenticated, CSRF-protected POST. | ||
|
|
||
| Provider completion callbacks are intentionally exempt from Django's CSRF token | ||
| check and rely on the selected core backend's protocol validation. Legacy | ||
| email and username login forms have no provider callback proof: submit them to | ||
| ``social:complete`` using a CSRF-protected POST instead. Do not exempt these | ||
| forms or expose an alternate completion route bypassing validation. | ||
|
Comment on lines
+550
to
+552
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The documented Useful? React with 👍 / 👎. |
||
|
|
||
| During authenticated account linking, preserve the initiating local user across | ||
| the callback; reject or restart a flow if the principal changes. For externally | ||
| resumed partials, preserve the explicit confirmation and nonce checks described | ||
| under :ref:`partial-pipeline`. | ||
|
|
||
| Restorable cross-site flows require shared server-side sessions and the same | ||
| browser context. See :doc:`../backends/saml` for supported session arrangements, | ||
| restoration, and upgrade troubleshooting. | ||
|
|
||
|
|
||
| Templates | ||
|
|
@@ -1206,16 +1222,20 @@ from ``social_django.constants`` or equivalent string literals: | |
| Endpoint Behaviors and Security Architecture | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| Both endpoints employ a layered defense model to protect users and your | ||
| application: | ||
| Both endpoints preserve issuer, redirect, framing, and CSRF checks. Fetch | ||
| Metadata headers influence navigation checks and automatic submission; they | ||
| are optional browser context signals, not credentials. Missing headers do not | ||
| remove the remaining checks. Keep these controls when overriding templates. | ||
| Bridge target validation remains active even if general | ||
| ``SOCIAL_AUTH_SANITIZE_REDIRECTS`` validation is disabled. | ||
|
|
||
| IdP Launch (``idp_launch``) | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| Route: ``/idp-launch/<str:backend>/`` (URL name: ``social:idp_launch``) | ||
|
|
||
| Designed to handle `OIDC IdP-initiated login per the OpenID Connect Core | ||
| specification <https://openid.net/specs/openid-connect-core-1_0-36.html#ThirdPartyInitiatedLogin>`_. Enforces 8 security layers: | ||
| specification <https://openid.net/specs/openid-connect-core-1_0-36.html#ThirdPartyInitiatedLogin>`_. Its behavior is: | ||
|
|
||
| 1. **Opt-In Gate**: Raises ``Http404`` if ``LaunchBridge.IDP`` (or | ||
| ``'idp_launch'``) is not present in ``SOCIAL_AUTH_ENABLE_LAUNCH_BRIDGES``. | ||
|
|
@@ -1247,7 +1267,8 @@ App Launch (``app_launch``) | |
|
|
||
| Route: ``/app-launch/<str:backend>/`` (URL name: ``social:app_launch``) | ||
|
|
||
| Designed for same-origin frontend or SPA redirects with OpenID Connect (OIDC) backends. Enforces 10 security layers: | ||
| Designed for same-origin frontend or SPA redirects with OpenID Connect (OIDC) | ||
| backends. Its behavior is: | ||
|
|
||
| 1. **Opt-In Gate**: Raises ``Http404`` if ``LaunchBridge.APP`` (or | ||
| ``'app_launch'``) is not present in ``SOCIAL_AUTH_ENABLE_LAUNCH_BRIDGES``. | ||
|
|
@@ -1333,10 +1354,13 @@ For example, to allow a frontend served on port 8443, include | |
| Customizing the Launch Template (``launch.html``) | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| Both bridge views render ``social_django/launch.html``. To customize the | ||
| appearance, loading animation, or branding during the transition, create a | ||
| file named ``social_django/launch.html`` within your project's ``templates`` | ||
| directory (ensuring your template loader prioritizes project templates). | ||
| Both bridge views render ``social_django/launch.html``. Overrides must retain | ||
| the CSRF token, forward only the supplied parameters, and honor ``auto_submit``: | ||
| when false, show a manual confirmation button instead of submitting the form | ||
| automatically. To customize the appearance, loading animation, or branding | ||
| during the transition, create ``social_django/launch.html`` within your | ||
| project's ``templates`` directory (ensuring your template loader prioritizes | ||
| project templates). | ||
|
|
||
| Template Context Variables | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new requirement conflicts with both canonical callback examples immediately above, which still use
http://example.com/complete/telegram/, including the copyabledata-auth-url. A user following the setup steps can therefore transmit a replayable signed callback over cleartext despite the security section requiring HTTPS; update both examples to usehttps://.Useful? React with 👍 / 👎.