You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Angelo Immediata <an...@libero.it> on 2005/07/19 18:48:58 UTC

Authentication problem

Hi all; i'm using Cocoon 2.1.7; i'm using cforms and cocoon portal block.
Well i have this scenario:
i have a my element that does the authentication, then i use a servlet in order to set in the session the authentication token for the logged user... well by using this function:

function autorizzazione () {
  try{
      var ccm = org.apache.cocoon.components.CocoonComponentManager.getSitemapComponentManager();
      var sessionManager = ccm.lookup(org.apache.cocoon.webapps.session.SessionManager.ROLE);
      var codiceFiscale = sessionManager.getContextFragment("authentication","/");
      var xmlUt = new XMLUtils();
      var stringhetta = xmlUt.serializeNode(codiceFiscale, new Properties());
      print("Stringa token: \n"+stringhetta);
      return stringhetta;
  
  }catch(x){
	print(x);
  }
}
I see this authentication token:

<?xml version="1.0" encoding="UTF-8"?>
<authentication>
	<ID>angelo</ID>
	<data>
		<user>angelo</user>
	</data>
	<role>static value undefined</role>
	<USERINFORMATION>
		<USERNAME>angelo</USERNAME>
		<NOME>Angelo</NOME>
		<COGNOME>Sempronio</COGNOME>
		<DATA_NASCITA>22/03/1974</DATA_NASCITA>
		<INDIRIZZO>VIA ROMA</INDIRIZZO>
		<CITTA>CAVA DEI TIRRENI</CITTA>
		<EMAIL>pippo@pi.it</EMAIL>
		<CODICE_FISCALE>MMDXXXXXXXXXXXXX</CODICE_FISCALE>
	</USERINFORMATION>
	<APPLICATIONS>
		<APPLICATION name="VSR">
			<GRANTS>
				<GRANT name="VISUALIZZA"/>
			</GRANTS>
		</APPLICATION>
		<APPLICATION name="ACS">
			<GRANTS>
				<GRANT name="VISUALIZZA"/>
			</GRANTS>
		</APPLICATION>
	</APPLICATIONS>
	<type>cocoon.authentication</type>
	<media>html</media>
</authentication>

Without logging out if i use this function:

function getCodiceFiscale () {

  var ccm = org.apache.cocoon.components.CocoonComponentManager.getSitemapComponentManager();
  var sessionManager = ccm.lookup(org.apache.cocoon.webapps.session.SessionManager.ROLE);
  var codiceFiscale = sessionManager.getContextFragment("authentication","/authentication/USERINFORMATION/CODICE_FISCALE").getFirstChild().getNodeValue();
  return codiceFiscale;

}

I don't see MMDXXXXXXXXXXXXX but only MM and nothing else.
Have you any ideas about this?
Thanks.



____________________________________________________________
6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Libero!
Scaricalo su INTERNET GRATIS 6X http://www.libero.it



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Authentication problem

Posted by Jorg Heymans <jh...@domek.be>.
Jorg Heymans wrote:
> Angelo Immediata wrote:
> 
> 
>>I don't see MMDXXXXXXXXXXXXX but only MM and nothing else.
> 
> 
> Have a look at SimpleSessionContext.java in
> src\blocks\session-fw\java\org\apache\cocoon\webapps\session\context\
> 
> IIUC, the getXML method is used there to retrieve your value. Maybe
> there is something wrong with the xpath expression ? Try it in isolation
> on a similar piece of xml to isolate any problems in your code.


Actually, try /authentication/USERINFORMATION/CODICE_FISCALE/text() ,
does that work?




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Authentication problem

Posted by Jorg Heymans <jh...@domek.be>.
Angelo Immediata wrote:

> I don't see MMDXXXXXXXXXXXXX but only MM and nothing else.

Have a look at SimpleSessionContext.java in
src\blocks\session-fw\java\org\apache\cocoon\webapps\session\context\

IIUC, the getXML method is used there to retrieve your value. Maybe
there is something wrong with the xpath expression ? Try it in isolation
on a similar piece of xml to isolate any problems in your code.


HTH
Jorg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org