Hi Alberto, Are you talking about a JAAS authentication module? If so, I think you also need to watch out a bit because I think the classloader used to load it may be different from the normal magnolia one. In any case, when the JAAS module successfully authenticates, the LoginFilter normally initializes a new session for the user. So if your authentication module was putting stuff in the session, those attributes will be gone. See: info.magnolia.cms.security.auth.login.LoginFilter line 90
You can use MgnlContext.setAttribute() so set properties in the request, session or application scope, depending on the scope parameter, see: info.magnolia.context.Context.LOCAL_SCOPE, info.magnolia.context.Context.SESSION_SCOPE or info.magnolia.context.Context.APPLICATION_SCOPE So, one solution might be that you set stuff in the request context (LOCAL_SCOPE) in the authentication-handler and then read them from there and transfer them to SESSION_SCOPE after the LoginFilter has created the new session (perhaps in your template model or perhaps in a custom filter for this purpose). Another solution might be to attach these variables to the user object returned by the authentication rather than the session. Hope this helps you, Regards from Vienna, Richard > -----Ursprüngliche Nachricht----- > Von: [email protected] [mailto:user-list-owner@magnolia- > cms.com] Im Auftrag von Alberto Giovannone (via Magnolia Forums) > Gesendet: Dienstag, 22. April 2014 14:08 > An: Magnolia User List > Betreff: [magnolia-user] Login Parameter and MgnlContext attribute > > Hi All, > I rewrite my AuthenticationModule for my login process and I tried to put > some parameter in the object called MgnlContext with the following > istruction : MgnlContext.setAttribute(key, value); When I try to retrieve this > parameter in one of my ftl page with this istruction : > ${ctx.getAttribute(key)!"nothing"} > I obtained only a null. > What I'd like to know if there is a way to pass parameters from the login > module to the pages and in general to the Form Processor. I mean something > like a session object, or and object that stays alive during the entire > execution of Magnolia. Actually If I take a look to MgnlContext in Login > Module is a diffentent istance of the one I can catch in a FormProcessor of > my form. It seems that after the loggin process the Context is reinitialized. > What's your suggestion about? > > > Thank you in advance for your help > > Regards from Milan. > > Alberto > > -- > Context is everything: http://forum.magnolia- > cms.com/forum/thread.html?threadId=8f5b9728-a3a8-44eb-ac08- > a97e358565e2 > > > ---------------------------------------------------------------- > For list details, see http://www.magnolia-cms.com/community/mailing- > lists.html > Alternatively, use our forums: http://forum.magnolia-cms.com/ > To unsubscribe, E-mail to: <[email protected]> > ---------------------------------------------------------------- ---------------------------------------------------------------- For list details, see http://www.magnolia-cms.com/community/mailing-lists.html Alternatively, use our forums: http://forum.magnolia-cms.com/ To unsubscribe, E-mail to: <[email protected]> ----------------------------------------------------------------
