微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

XMLSchemaImportWarning:导入命名空间“http://www.w3.org/2001/04/xmlenc#”

如何解决XMLSchemaImportWarning:导入命名空间“http://www.w3.org/2001/04/xmlenc#”

我正在尝试将 SAML2 Auth 集成到现有的 django 项目中。但是我一直收到这个错误

F:\finessevenv\lib\site-packages\saml2\xml\schema\__init__.py:18: XMLSchemaimportWarning: Import of namespace 'http://www.w3.org/2000/09/xmldsig#' from ['http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd'] Failed: block access to remote resource http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd.
  return _XMLSchema(source,**kwargs)
F:\finessevenv\lib\site-packages\saml2\xml\schema\__init__.py:18: XMLSchemaimportWarning: Import of namespace 'http://www.w3.org/2001/04/xmlenc#' from ['http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/xenc-schema.xsd'] Failed: block access to remote resource http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/xenc-schema.xsd.
  return _XMLSchema(source,**kwargs)
F:\finessevenv\lib\site-packages\xmlschema\validators\schema.py:1191: XMLSchemaimportWarning: Import of namespace 'http://www.w3.org/2000/09/xmldsig#' from ['http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd'] Failed: block access to remote resource http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd.
  build=build,F:\finessevenv\lib\site-packages\xmlschema\validators\schema.py:1191: XMLSchemaimportWarning: Import of namespace 'http://www.w3.org/2001/04/xmlenc#' from ['http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/xenc-schema.xsd'] Failed: block access to remote resource http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/xenc-schema.xsd.
  build=build,

错误的可能原因是什么,我该如何解决

解决方法

首先,尝试使用更新版本的 django-saml2-auth。出于需要,我尝试维护原始项目。

其次,您是否安装了 xmlsec1 二进制文件?如果没有,请在项目网站上查看由 Igor Zlatkovic 构建和发布的 Windows binaries

如果上述方法均无法解决问题,则您的 Django 应用或身份提供者应用可能存在配置问题。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。