By: Bryan Sumon user 25 Mar 2021 at 10:02 a.m. CDT

3 Responses
Bryan Sumon gravatar
To use context.set() method in my Person Authentication Script, I wrote this line on the top of the script : "from org.jboss.seam.contexts import Context, Contexts" But I probably miss something cause when I reach my custom login page, I got this error : "ImportError: No module named seam" Can you explain me how can I solve this issue to use cotext.set() method which allows me to pass values between steps in my custom person authentication script ? Thank you in advance.

By Michael Schwartz staff 25 Mar 2021 at 10:20 a.m. CDT

Michael Schwartz gravatar
It's probably an older script, because Seam --> Weld. Maybe Madhu can give you a quick pointer.

By Madhumita Subramaniam staff 26 Mar 2021 at 2:53 a.m. CDT

Madhumita Subramaniam gravatar
Instead of: ``` from org.jboss.seam.contexts import Contexts ... context = Contexts.getEventContext() context.set(param, value) context.get(param) ``` use: ``` from org.gluu.oxauth.security import Identity ... identity = CdiUtil.bean(Identity) identity.setWorkingParameter(param, value) identity.getWorkingParameter(param) ``` Also ensure you have this method - getExtraParametersForStep(): If required to save session variables between steps, use the getExtraParametersForStep method. The Gluu Server persists these variables in LDAP in able to support stateless, clustered two-step authentications. Assuming test is a variable that you want to save between steps then a sample code snippet looks like this - ``` def getExtraParametersForStep(self, configurationAttributes, step): return Arrays.asList("test") ```

By Bryan Sumon user 31 Mar 2021 at 11:47 a.m. CDT

Bryan Sumon gravatar
Thanks for your support guys, the issue is solved.