You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by 許議中 <jo...@erp.tw> on 2007/01/18 12:58:42 UTC

How to get authentication contex in auth-fw

Hi!

How to get authentication contex in auth-fw(flow), in the samples.js login function, I want to get some info from it, I use this method

if (auth_login(handler, null, cocoon.parameters)) {
   	var contextMan = cocoon.getComponent(Packages.org.apache.cocoon.webapps.session.ContextManager.ROLE);
   	var authContext = contextMan.getContext("authentication");
   	var authentication = authContext.getXML("/authentication");
print("authentication = "+authentication);
    success();

but the authentication show [#document-fragment: null].

Best Regards

johnson

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


Re: How to get authentication contex in auth-fw -- solve

Posted by 許議中 <jo...@erp.tw>.
got it, lack of this line

   	var contextMan = cocoon.getComponent(Packages.org.apache.cocoon.webapps.session.ContextManager.ROLE);
   	var authContext = contextMan.getContext("authentication");
   	var userFrag = authContext.getXML("/authentication/ID");
    var user = Packages.org.apache.cocoon.xml.dom.DOMUtil.getValueOfNode(userFrag);  ---this


許議中 提到:
> Hi!
> 
> How to get authentication contex in auth-fw(flow), in the samples.js login function, I want to get some info from it, I use this method
> 
> if (auth_login(handler, null, cocoon.parameters)) {
>    	var contextMan = cocoon.getComponent(Packages.org.apache.cocoon.webapps.session.ContextManager.ROLE);
>    	var authContext = contextMan.getContext("authentication");
>    	var authentication = authContext.getXML("/authentication");
> print("authentication = "+authentication);
>     success();
> 
> but the authentication show [#document-fragment: null].
> 
> Best Regards
> 
> johnson
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org



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