Example sp not functioning
See original GitHub issueThe example SP in the sp-wsgi dict continues to throw a syntax error when following the sp example instructions.
File "/Users/name/opt/anaconda3/lib/python3.8/xml/etree/ElementTree.py", line 1602, in _raiseerror
raise err
xml.etree.ElementTree.ParseError: syntax error: line 1, column 0
Code Version
Using Python 3.8 and pysaml2 6.2.0
Expected Behavior
The sample service provider should run.
Current Behavior
The code throws a parsing error. Here is the traceback:
Traceback (most recent call last):
File "/Users/name/opt/anaconda3/lib/python3.8/xml/etree/ElementTree.py", line 1693, in feed
self.parser.Parse(data, 0)
xml.parsers.expat.ExpatError: syntax error: line 1, column 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "sp.py", line 973, in <module>
SP = Saml2Client(config_file="%s" % CNFBASE)
File "/Users/name/opt/anaconda3/lib/python3.8/site-packages/saml2/client_base.py", line 152, in __init__
Entity.__init__(self, "sp", config, config_file, virtual_organization,
File "/Users/name/opt/anaconda3/lib/python3.8/site-packages/saml2/entity.py", line 135, in __init__
self.config = config_factory(entity_type, config_file)
File "/Users/name/opt/anaconda3/lib/python3.8/site-packages/saml2/config.py", line 533, in config_factory
conf.load_file(config)
File "/Users/name/opt/anaconda3/lib/python3.8/site-packages/saml2/config.py", line 392, in load_file
return self.load(copy.deepcopy(mod.CONFIG), metadata_construction)
File "/Users/name/opt/anaconda3/lib/python3.8/site-packages/saml2/config.py", line 372, in load
self.load_complex(cnf, metadata_construction=metadata_construction)
File "/Users/name/opt/anaconda3/lib/python3.8/site-packages/saml2/config.py", line 303, in load_complex
self.load_metadata(cnf["metadata"]))
File "/Users/name/opt/anaconda3/lib/python3.8/site-packages/saml2/config.py", line 415, in load_metadata
mds.imp(metadata_conf)
File "/Users/name/opt/anaconda3/lib/python3.8/site-packages/saml2/mdstore.py", line 1019, in imp
self.load(key, val)
File "/Users/name/opt/anaconda3/lib/python3.8/site-packages/saml2/mdstore.py", line 1005, in load
_md.load()
File "/Users/name/opt/anaconda3/lib/python3.8/site-packages/saml2/mdstore.py", line 707, in load
return self.parse_and_check_signature(_txt)
File "/Users/name/opt/anaconda3/lib/python3.8/site-packages/saml2/mdstore.py", line 670, in parse_and_check_signature
self.parse(txt)
File "/Users/name/opt/anaconda3/lib/python3.8/site-packages/saml2/mdstore.py", line 557, in parse
self.entities_descr = md.entities_descriptor_from_string(xmlstr)
File "/Users/name/opt/anaconda3/lib/python3.8/site-packages/saml2/md.py", line 1859, in entities_descriptor_from_string
return saml2.create_class_from_xml_string(EntitiesDescriptor, xml_string)
File "/Users/name/opt/anaconda3/lib/python3.8/site-packages/saml2/__init__.py", line 92, in create_class_from_xml_string
tree = defusedxml.ElementTree.fromstring(xml_string)
File "/Users/name/opt/anaconda3/lib/python3.8/site-packages/defusedxml/common.py", line 131, in fromstring
parser.feed(text)
File "/Users/name/opt/anaconda3/lib/python3.8/xml/etree/ElementTree.py", line 1695, in feed
self._raiseerror(v)
File "/Users/name/opt/anaconda3/lib/python3.8/xml/etree/ElementTree.py", line 1602, in _raiseerror
raise err
xml.etree.ElementTree.ParseError: syntax error: line 1, column 0
Possible Solution
It may have something to do with the sp_conf file, but I left it completely unchanged.
Steps to Reproduce
- following the instructions in the sp example threw an error. I’m unsure what I changed.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Trying to FIX: Game Boy Advance SP with MULTIPLE FAULTS
Hi, in this video I attempt to fix a Game Boy Advance SP with multiple faults. The known faults are a faulty game...
Read more >SP.js file not loaded in a simple JSOM example
I am working on SharePoint 2013 enterprise edition and I have not used custom master page. I am not able to figure out...
Read more >i need working example of <sp-editable-field> - ServiceNow
Solved: Hi, Need working example of html// //cleint controller var c = this; var gformDepartment, gformLocation, scopeDepartment,
Read more >sp_dropserver and sp_addserver not working - Stack Overflow
@@SERVERNAME reports changes made to the local server name using the sp_addserver or sp_dropserver stored procedure. And the first comment is correct.
Read more >Working with parameters in the sp_executesql stored procedure
As shown in this section, when executing a static SQL query, there is no benefit of using the sp_executesql stored procedure. Executing dynamic ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I see the problem. The config has changed and always tries to load the metadata. To generate the metadata for the SP, the IDP metadata need to be there and vice versa. This is now a chicken & egg problem.
Use the following as an initial
idp.xml
for now. I need to revisit the Config object and think how to make this work correctly.I see… Well, I just used the
idp.xml
you provided and my examples work now! Thank you for your help 😃