Skip to content

[FIX] auth_saml: decrypt matching_value response to compare output - #9

Open
edy1192 wants to merge 1 commit into
Vauxoo:16.0from
vauxoo-dev:16.0-dev-fix-matching-value-return
Open

[FIX] auth_saml: decrypt matching_value response to compare output#9
edy1192 wants to merge 1 commit into
Vauxoo:16.0from
vauxoo-dev:16.0-dev-fix-matching-value-return

Conversation

@edy1192

@edy1192 edy1192 commented Mar 13, 2025

Copy link
Copy Markdown

Decrypt matching_value response to compare output response with response.name_id.text. It shows AttributeError: 'NoneType' object has no attribute 'text'.

2023-09-17 02:02:54,015 4049 ERROR odoo
odoo.addons.auth_saml.controllers.main: SAML2: failure - 'NoneType'
object has no attribute 'text'
Traceback (most recent call last):
  File
"/home/odoo/instance/extra_addons/server-auth/auth_saml/controllers/main.py",
line 219, in signin
    .auth_saml(
  File
"/home/odoo/instance/extra_addons/server-auth/auth_saml/models/res_users.py",
line 64, in auth_saml
    validation = self._auth_saml_validate(provider, saml_response,
base_url)
  File
"/home/odoo/instance/extra_addons/server-auth/auth_saml/models/res_users.py",
line 29, in _auth_saml_validate
    return provider._validate_auth_response(token, base_url)
  File
"/home/odoo/instance/extra_addons/server-auth/auth_saml/models/auth_saml_provider.py",
line 296, in _validate_auth_response
    matching_value = response.name_id.text
AttributeError: 'NoneType' object has no attribute 'text'

Check class SecurityContext in saml2 lib

@edy1192
edy1192 force-pushed the 16.0-dev-fix-matching-value-return branch from 351f6ce to ae284a7 Compare March 13, 2025 21:43
@codecov-commenter

codecov-commenter commented Mar 13, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.42%. Comparing base (dbebd70) to head (c1b593f).
⚠️ Report is 356 commits behind head on 16.0.

Additional details and impacted files
@@            Coverage Diff             @@
##             16.0       #9      +/-   ##
==========================================
+ Coverage   88.83%   92.42%   +3.58%     
==========================================
  Files         115      212      +97     
  Lines        3028     5726    +2698     
  Branches      369      416      +47     
==========================================
+ Hits         2690     5292    +2602     
- Misses        241      290      +49     
- Partials       97      144      +47     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@edy1192
edy1192 force-pushed the 16.0-dev-fix-matching-value-return branch from ae284a7 to 2b7e198 Compare March 13, 2025 21:49
response.name_id.text

Decrypt matching_value response to compare output response with
response.name_id.text. It shows AttributeError: 'NoneType' object has no
attribute 'text'.

```python
2023-09-17 02:02:54,015 4049 ERROR odoo
odoo.addons.auth_saml.controllers.main: SAML2: failure - 'NoneType'
object has no attribute 'text'
Traceback (most recent call last):
  File
"/home/odoo/instance/extra_addons/server-auth/auth_saml/controllers/main.py",
line 219, in signin
    .auth_saml(
  File
"/home/odoo/instance/extra_addons/server-auth/auth_saml/models/res_users.py",
line 64, in auth_saml
    validation = self._auth_saml_validate(provider, saml_response,
base_url)
  File
"/home/odoo/instance/extra_addons/server-auth/auth_saml/models/res_users.py",
line 29, in _auth_saml_validate
    return provider._validate_auth_response(token, base_url)
  File
"/home/odoo/instance/extra_addons/server-auth/auth_saml/models/auth_saml_provider.py",
line 296, in _validate_auth_response
    matching_value = response.name_id.text
AttributeError: 'NoneType' object has no attribute 'text'
```

Check [class SecurityContext in saml2
lib](https://github.com/IdentityPython/pysaml2/blob/master/src/saml2/sigver.py#L1186)
@edy1192
edy1192 force-pushed the 16.0-dev-fix-matching-value-return branch from 2b7e198 to c1b593f Compare December 29, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants