Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ PYTEST=pytest
COVERAGE=coverage
COVERAGE_CONFIG=tests/coverage.rc
COVERALLS=coveralls
MAIN_SOURCE=src/onelogin/saml2
MAIN_SOURCE=src/python3_saml/saml2
DEMOS=demo-django demo-flask demo-tornado demo_pyramid
TESTS=tests/src/OneLogin/saml2_tests
TESTS=tests/src/Python3Saml/saml2_tests
SOURCES=$(MAIN_SOURCE) $(DEMOS) $(TESTS)

install-req:
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ The toolkit is hosted on GitHub. You can download it from:
* Latest release: https://github.com/saml-toolkits/python3-saml/releases/latest
* Master repo: https://github.com/saml-toolkits/python3-saml/tree/master

Find the core of the library at ``src/onelogin/saml2`` folder.
Find the core of the library at ``src/python3_saml/saml2`` folder.

#### Option 2. Download from pypi ####

Expand Down Expand Up @@ -165,7 +165,7 @@ In order to avoid them, the SP can keep a list of SAML Messages or Assertion IDs
to be stored the amount of time of the SAML Message life time, so
we don't need to store all processed message/assertion Ids, but the most recent ones.

The OneLogin_Saml2_Auth class contains the [get_last_request_id](https://github.com/onelogin/python3-saml/blob/ab62b0d6f3e5ac2ae8e95ce3ed2f85389252a32d/src/onelogin/saml2/auth.py#L357), [get_last_message_id](https://github.com/onelogin/python3-saml/blob/ab62b0d6f3e5ac2ae8e95ce3ed2f85389252a32d/src/onelogin/saml2/auth.py#L364) and [get_last_assertion_id](https://github.com/onelogin/python3-saml/blob/ab62b0d6f3e5ac2ae8e95ce3ed2f85389252a32d/src/onelogin/saml2/auth.py#L371) methods to retrieve the IDs
The OneLogin_Saml2_Auth class contains the `get_last_request_id`, `get_last_message_id` and `get_last_assertion_id` methods to retrieve the IDs

Checking that the ID of the current Message/Assertion does not exists in the list of the ones already processed will prevent replay attacks.

Expand All @@ -181,7 +181,7 @@ Let's start describing them:

#### src ####

This folder contains the heart of the toolkit, **onelogin/saml2** folder contains the new version of
This folder contains the heart of the toolkit, **python3_saml/saml2** folder contains the new version of
the classes and methods that are described in a later section.

#### demo-django ####
Expand Down Expand Up @@ -240,12 +240,12 @@ make pytest
```
The previous line will run the tests for the whole toolkit. You can also run the tests for a specific module. To do so for the auth module you would have to execute this:
```
pytest tests/src/OneLogin/saml2_tests/auth_test.py::OneLogin_Saml2_Auth_Test
pytest tests/src/Python3Saml/saml2_tests/auth_test.py::Python3Saml_Saml2_Auth_Test
```

Or for an specific method:
```
pytest tests/src/OneLogin/saml2_tests/auth_test.py::OneLogin_Saml2_Auth_Test::testBuildRequestSignature
pytest tests/src/Python3Saml/saml2_tests/auth_test.py::Python3Saml_Saml2_Auth_Test::testBuildRequestSignature
```


Expand Down Expand Up @@ -325,7 +325,7 @@ This is the ``settings.json`` file:
},
// Specifies the constraints on the name identifier to be used to
// represent the requested subject.
// Take a look on src/onelogin/saml2/constants.py to see the NameIdFormat that are supported.
// Take a look on src/python3_saml/saml2/constants.py to see the NameIdFormat that are supported.
"NameIDFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified",
// Usually X.509 cert and privateKey of the SP are provided by files placed at
// the certs folder. But we can also provide them with the following parameters
Expand Down Expand Up @@ -609,9 +609,9 @@ In order to use the toolkit library you need to import the file that contains th
on the top of your python file.

``` python
from onelogin.saml2.auth import OneLogin_Saml2_Auth
from onelogin.saml2.settings import OneLogin_Saml2_Settings
from onelogin.saml2.utils import OneLogin_Saml2_Utils
from python3_saml.saml2.auth import OneLogin_Saml2_Auth
from python3_saml.saml2.settings import OneLogin_Saml2_Settings
from python3_saml.saml2.utils import OneLogin_Saml2_Utils
```

#### The Request ####
Expand Down Expand Up @@ -678,7 +678,7 @@ An explanation of some advanced request parameters:
In order to send an ``AuthNRequest`` to the IdP:

```python
from onelogin.saml2.auth import OneLogin_Saml2_Auth
from python3_saml.saml2.auth import OneLogin_Saml2_Auth

req = prepare_request_for_toolkit(request)
auth = OneLogin_Saml2_Auth(req) # Constructor of the SP, loads settings.json
Expand Down
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# python3-saml changelog
### 2.0.0 (Oct 29, 2025)
- Move namespace from onelogin to python3_saml to avoid conflicts with onelogin

### 1.16.0 (Oct 9, 2023)
- [#364](https://github.com/SAML-Toolkits/python3-saml/commit/d1bfaeb17a786735827b8252b91deafde29dabd8) Improve get_metadata method from Parser, allowing to set headers
- Fix WantAuthnRequestsSigned parser
Expand Down
6 changes: 3 additions & 3 deletions demo-django/demo/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseServerError
from django.shortcuts import render

from onelogin.saml2.auth import OneLogin_Saml2_Auth
from onelogin.saml2.settings import OneLogin_Saml2_Settings
from onelogin.saml2.utils import OneLogin_Saml2_Utils
from python3_saml.saml2.auth import OneLogin_Saml2_Auth
from python3_saml.saml2.settings import OneLogin_Saml2_Settings
from python3_saml.saml2.utils import OneLogin_Saml2_Utils


def init_saml_auth(req):
Expand Down
4 changes: 2 additions & 2 deletions demo-flask/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from flask import Flask, request, render_template, redirect, session, make_response

from onelogin.saml2.auth import OneLogin_Saml2_Auth
from onelogin.saml2.utils import OneLogin_Saml2_Utils
from python3_saml.saml2.auth import OneLogin_Saml2_Auth
from python3_saml.saml2.utils import OneLogin_Saml2_Utils


app = Flask(__name__)
Expand Down
4 changes: 2 additions & 2 deletions demo-tornado/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import tornado.httpserver
import tornado.httputil

from onelogin.saml2.auth import OneLogin_Saml2_Auth
from onelogin.saml2.utils import OneLogin_Saml2_Utils
from python3_saml.saml2.auth import OneLogin_Saml2_Auth
from python3_saml.saml2.utils import OneLogin_Saml2_Utils

# Global session info
session = {}
Expand Down
4 changes: 2 additions & 2 deletions demo_pyramid/demo_pyramid/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
)
from pyramid.view import view_config

from onelogin.saml2.auth import OneLogin_Saml2_Auth
from onelogin.saml2.utils import OneLogin_Saml2_Utils
from python3_saml.saml2.auth import OneLogin_Saml2_Auth
from python3_saml.saml2.utils import OneLogin_Saml2_Utils

SAML_PATH = os.path.join(os.path.dirname(__file__), "saml")

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ lint = [
package-dir = {"" = "src"}

[tool.setuptools.package-data]
"onelogin.saml2.schemas" = ["*.xsd"]
"python3_saml.saml2.schemas" = ["*.xsd"]

[tool.pytest.ini_options]
minversion = "4.6.11"
Expand Down Expand Up @@ -99,7 +99,7 @@ branch = true

[tool.coverage.paths]
source = [
"src/onelogin/saml2"
"src/python3_saml/saml2"
]

[tool.coverage.report]
Expand Down
File renamed without changes.
File renamed without changes.
18 changes: 9 additions & 9 deletions src/onelogin/saml2/auth.py → src/python3_saml/saml2/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@

import xmlsec

from onelogin.saml2 import compat
from onelogin.saml2.authn_request import OneLogin_Saml2_Authn_Request
from onelogin.saml2.constants import OneLogin_Saml2_Constants
from onelogin.saml2.logout_request import OneLogin_Saml2_Logout_Request
from onelogin.saml2.logout_response import OneLogin_Saml2_Logout_Response
from onelogin.saml2.response import OneLogin_Saml2_Response
from onelogin.saml2.settings import OneLogin_Saml2_Settings
from onelogin.saml2.utils import OneLogin_Saml2_Utils, OneLogin_Saml2_Error, OneLogin_Saml2_ValidationError
from onelogin.saml2.xmlparser import tostring
from python3_saml.saml2 import compat
from python3_saml.saml2.authn_request import OneLogin_Saml2_Authn_Request
from python3_saml.saml2.constants import OneLogin_Saml2_Constants
from python3_saml.saml2.logout_request import OneLogin_Saml2_Logout_Request
from python3_saml.saml2.logout_response import OneLogin_Saml2_Logout_Response
from python3_saml.saml2.response import OneLogin_Saml2_Response
from python3_saml.saml2.settings import OneLogin_Saml2_Settings
from python3_saml.saml2.utils import OneLogin_Saml2_Utils, OneLogin_Saml2_Error, OneLogin_Saml2_ValidationError
from python3_saml.saml2.xmlparser import tostring


class OneLogin_Saml2_Auth(object):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

"""

from onelogin.saml2.constants import OneLogin_Saml2_Constants
from onelogin.saml2.utils import OneLogin_Saml2_Utils
from onelogin.saml2.xml_templates import OneLogin_Saml2_Templates
from python3_saml.saml2.constants import OneLogin_Saml2_Constants
from python3_saml.saml2.utils import OneLogin_Saml2_Utils
from python3_saml.saml2.xml_templates import OneLogin_Saml2_Templates


class OneLogin_Saml2_Authn_Request(object):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

import ssl

from onelogin.saml2.constants import OneLogin_Saml2_Constants
from onelogin.saml2.xml_utils import OneLogin_Saml2_XML
from python3_saml.saml2.constants import OneLogin_Saml2_Constants
from python3_saml.saml2.xml_utils import OneLogin_Saml2_XML


class OneLogin_Saml2_IdPMetadataParser(object):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

"""

from onelogin.saml2 import compat
from onelogin.saml2.constants import OneLogin_Saml2_Constants
from onelogin.saml2.utils import OneLogin_Saml2_Utils, OneLogin_Saml2_Error, OneLogin_Saml2_ValidationError
from onelogin.saml2.xml_templates import OneLogin_Saml2_Templates
from onelogin.saml2.xml_utils import OneLogin_Saml2_XML
from python3_saml.saml2 import compat
from python3_saml.saml2.constants import OneLogin_Saml2_Constants
from python3_saml.saml2.utils import OneLogin_Saml2_Utils, OneLogin_Saml2_Error, OneLogin_Saml2_ValidationError
from python3_saml.saml2.xml_templates import OneLogin_Saml2_Templates
from python3_saml.saml2.xml_utils import OneLogin_Saml2_XML


class OneLogin_Saml2_Logout_Request(object):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

"""

from onelogin.saml2 import compat
from onelogin.saml2.constants import OneLogin_Saml2_Constants
from onelogin.saml2.utils import OneLogin_Saml2_Utils, OneLogin_Saml2_ValidationError
from onelogin.saml2.xml_templates import OneLogin_Saml2_Templates
from onelogin.saml2.xml_utils import OneLogin_Saml2_XML
from python3_saml.saml2 import compat
from python3_saml.saml2.constants import OneLogin_Saml2_Constants
from python3_saml.saml2.utils import OneLogin_Saml2_Utils, OneLogin_Saml2_ValidationError
from python3_saml.saml2.xml_templates import OneLogin_Saml2_Templates
from python3_saml.saml2.xml_utils import OneLogin_Saml2_XML


class OneLogin_Saml2_Logout_Response(object):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
from time import gmtime, strftime, time
from datetime import datetime

from onelogin.saml2 import compat
from onelogin.saml2.constants import OneLogin_Saml2_Constants
from onelogin.saml2.utils import OneLogin_Saml2_Utils
from onelogin.saml2.xml_templates import OneLogin_Saml2_Templates
from onelogin.saml2.xml_utils import OneLogin_Saml2_XML
from python3_saml.saml2 import compat
from python3_saml.saml2.constants import OneLogin_Saml2_Constants
from python3_saml.saml2.utils import OneLogin_Saml2_Utils
from python3_saml.saml2.xml_templates import OneLogin_Saml2_Templates
from python3_saml.saml2.xml_utils import OneLogin_Saml2_XML

try:
basestring
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"""

from copy import deepcopy
from onelogin.saml2.constants import OneLogin_Saml2_Constants
from onelogin.saml2.utils import OneLogin_Saml2_Utils, OneLogin_Saml2_Error, OneLogin_Saml2_ValidationError, return_false_on_exception
from onelogin.saml2.xml_utils import OneLogin_Saml2_XML
from python3_saml.saml2.constants import OneLogin_Saml2_Constants
from python3_saml.saml2.utils import OneLogin_Saml2_Utils, OneLogin_Saml2_Error, OneLogin_Saml2_ValidationError, return_false_on_exception
from python3_saml.saml2.xml_utils import OneLogin_Saml2_XML


class OneLogin_Saml2_Response(object):
Expand Down
Loading
Loading