在微软azure的应用程序上实现了odoo中的SAML单点登录



我正在尝试将Azure AD应用程序的单点登录实现到odoo。我在Azure中创建了应用程序并添加了SSO设置,我下载了auth_saml并安装在odoo中。然后我配置了odoo-saml提供程序。当我从azure测试连接时,我得到了500错误,同样来自oddo。我正在底部粘贴错误日志,请帮忙,我被困在这里两天了。提前谢谢。

2021-12-10 02:57:32,491 29639 ERROR mydb werkzeug: Error on request:
Traceback (most recent call last):
File "/Users/hemanthbethu/Xaana/enigma/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
result = request.dispatch()
File "/Users/hemanthbethu/Xaana/enigma/odoo/http.py", line 810, in dispatch
r = self._call_function(**self.params)
File "/Users/hemanthbethu/Xaana/enigma/odoo/http.py", line 359, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/Users/hemanthbethu/Xaana/enigma/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/Users/hemanthbethu/Xaana/enigma/odoo/http.py", line 348, in checked_call
result = self.endpoint(*a, **kw)
File "/Users/hemanthbethu/Xaana/enigma/odoo/http.py", line 916, in __call__
return self.method(*args, **kw)
File "/Users/hemanthbethu/Xaana/enigma/odoo/http.py", line 535, in response_wrap
response = f(*args, **kw)
File "/Users/hemanthbethu/Xaana/enigma/addons/auth_saml/controllers/main.py", line 137, in get_auth_request
self._get_saml_extra_relaystate(), request.httprequest.url_root.rstrip("/")
File "/Users/hemanthbethu/Xaana/enigma/addons/auth_saml/models/auth_saml_provider.py", line 216, in _get_auth_request
saml_client = self._get_client_for_provider(url_root)
File "/Users/hemanthbethu/Xaana/enigma/addons/auth_saml/models/auth_saml_provider.py", line 194, in _get_client_for_provider
spConfig = self._get_config_for_provider(base_url)
File "/Users/hemanthbethu/Xaana/enigma/addons/auth_saml/models/auth_saml_provider.py", line 186, in _get_config_for_provider
"key_file": self._get_cert_key_path("sp_pem_private"),
File "/Users/hemanthbethu/Xaana/enigma/addons/auth_saml/models/auth_saml_provider.py", line 146, in _get_cert_key_path
keys_path = model_attachment._full_path(keys.store_fname)
File "/Users/hemanthbethu/Xaana/enigma/odoo/addons/base/models/ir_attachment.py", line 91, in _full_path
path = re.sub('[.]', '', path)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/re.py", line 194, in sub
return _compile(pattern, flags).sub(repl, string, count)
Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/werkzeug/serving.py", line 306, in run_wsgi
execute(self.server.app)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/werkzeug/serving.py", line 294, in execute
application_iter = app(environ, start_response)
File "/Users/hemanthbethu/Xaana/enigma/odoo/service/server.py", line 476, in app
return self.app(e, s)
File "/Users/hemanthbethu/Xaana/enigma/odoo/service/wsgi_server.py", line 112, in application
return application_unproxied(environ, start_response)
File "/Users/hemanthbethu/Xaana/enigma/odoo/service/wsgi_server.py", line 87, in application_unproxied
result = odoo.http.root(environ, start_response)
File "/Users/hemanthbethu/Xaana/enigma/odoo/http.py", line 1313, in __call__
return self.dispatch(environ, start_response)
File "/Users/hemanthbethu/Xaana/enigma/odoo/http.py", line 1279, in __call__
return self.app(environ, start_wrapped)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/werkzeug/middleware/shared_data.py", line 220, in __call__
return self.app(environ, start_response)
File "/Users/hemanthbethu/Xaana/enigma/odoo/http.py", line 1489, in dispatch
result = ir_http._dispatch()
File "/Users/hemanthbethu/Xaana/enigma/odoo/addons/base/models/ir_http.py", line 241, in _dispatch
return cls._handle_exception(e)
File "/Users/hemanthbethu/Xaana/enigma/odoo/addons/base/models/ir_http.py", line 209, in _handle_exception
return request._handle_exception(exception)
File "/Users/hemanthbethu/Xaana/enigma/odoo/http.py", line 748, in _handle_exception
return super(HttpRequest, self)._handle_exception(exception)
File "/Users/hemanthbethu/Xaana/enigma/odoo/http.py", line 301, in _handle_exception
raise exception.with_traceback(None) from new_cause
TypeError: expected string or bytes-like object - - -

似乎没有设置证书或密钥的路径。因此,该模块尝试处理一个空字符串,但失败了。

虽然您没有检查";符号";复选框是3.0版本中的错误,报告如下:https://github.com/OCA/server-auth/issues/315.作为一种临时解决方法,创建一个证书和密钥并上传它们,请取消选中sign按钮。

如果您决定使用";符号";复选框,您可能会遇到进一步的问题,如中所述https://github.com/OCA/server-auth/issues/321如果身份提供者没有对断言进行签名,则会引发错误。

最新更新