Hi Peter,
thanks again. I already experimented with a XML file earlier today. It is really ridiculous: if I save the XML document generated by the original authenticator to file as (e.g.) /tmp/authentication.xml and modify the sitemap to:
<map:match pattern="authenticate">
<map:generate src="/tmp/authenticate.xml" />
<map:serialize type="xml" />
</map:match>the authentication works fine! NOTE AGAIN: The authenticate.xml is an -exact- copy of the XML document produced by the orginal authenticator with the two SAME request parameters password and userid that I have used before! The only difference is that the result of the authenticator is stored in a file. The content of the /tmp/authentication.xml is
<?xml version="1.0" encoding="ISO-8859-1"?> <authentication> <ID>1113937509670</ID> <surname>juffer</surname> <email>[EMAIL PROTECTED]</email> <role>author</role> </authentication>
(I have put things on separate lines for readability. The part after <?xml version="1.0" encoding="ISO-8859-1"?> is on a single line in the file.)
The core.log now correctly shows
DEBUG (2005-05-02) 22:42.45:311 [core.authentication-manager] (/sopas/do-login) http-8080-Processor24/PipelineAuthen
ticator: BEGIN isValidAuthenticationFragment fragment=<?xml version="1.0" encoding="UTF-8"?>
<authentication><ID>1113937509670</ID><surname>juffer</surname><email>[EMAIL PROTECTED]</email><role>author</role></a
uthentication>
Remember that with the original pipeline in the sitemap the part after <?xml version="1.0" encoding="ISO-8859-1"?> is simply not available in the PipelineAuthenticator. It should simply work!
Andre.
[EMAIL PROTECTED] wrote:
Andre Juffer <[EMAIL PROTECTED]> wrote on 02-05-2005 14:42:19:
[EMAIL PROTECTED] wrote:
Andre Juffer <[EMAIL PROTECTED]> wrote on 30-04-2005 14:52:29:
Peter and others,
concerning the authentication resource, I eventually found the
following
in core.log:
DEBUG (2005-04-30) 15:28.26:711 [core.authentication-manager] (/sopas/do-login) http-8080-Processor25/PipelineAuthen ticator: BEGIN isValidAuthenticationFragment fragment=<?xml version="1.0" encoding="UTF-8"?>
When the PipelineAuthenticator starts validating the XML fragment, it prints the entire fragment to the log. So at that point, your entire fragment is <?xml version="1.0" encoding="UTF-8"?> and nothing else, no <authentication> etc.
Perhaps this helps?
Actually, in the log file, there is an empty line just below DEBUG (2005-04-30) 15:28.26:711 [core.authentication-manager] (/sopas/do-login) http-8080-Processor25/PipelineAuthen ticator: BEGIN isValidAuthenticationFragment fragment=<?xml version="1.0" encoding="UTF-8"?>
While the authenticator definitly returns the correct response (see previous emails), the rest of the document is not available to the PipelineAuthenticator, it apparently just gets the first line. By looking at the source code of PipelineAuthenticator, I thought initially that the <?xml version="1.0" encoding="UTF-8"?> should not be there, just the XML itself, but this seems rubbish now.
I guess I somehow need to get rid of new lines characters or spaces or whatsoever in the returned XML document, so that the PipelineAuthenticator sees one line only. Maybe that is the solution to this. So, instead of
<?xml version="1.0" encoding="UTF-8"?> <authentication> ... </authentication>
I would need to generate
<?xml version="1.0"
encoding="UTF-8"?><authentication>...</authentication>
(this all is one line).
I would be surprised if it was the whitespace. But I have no explanation yet. So while nobody steps in and tells us what the problem is, we'll just have to stumble forward. Let's see what we have: - When you type ...authenticate.xxx in your browser, you get the right XML - When authenticate.xxx is called during authentication, it is mostly empty So there must be *some* difference. The only differences I can think of are request parameters. So you could test a situation where request parameters cannot screw you up. You could simply create an XML somedir/test.xml like this: <?xml version="1.0" encoding="UTF-8"?> <authentication> <ID>Me</ID> </authentication> And then change your sitemap like this: <map:match pattern="authenticate.xxx"> <map:generate src="somedir/test.xml" /> <map:serialize type="xml" /> </map:match> If this works (it must!) there are only three possibilities left (that I can think of): - the extra match <map:match type="request-parameter" pattern="userid"> is wrong - something in authenticate.xsl - something fishy in the XML produced by the XML database. I've never worked with XML databases, so I can't help you there.
Best of luck, Peter
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--
Andre H. Juffer | Phone: +358-8-553 1161
The Biocenter and | Fax: +358-8-553-1141
the Dep. of Biochemistry | Email: [EMAIL PROTECTED]
University of Oulu, Finland | WWW: www.biochem.oulu.fi/Biocomputing/--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
