By: Sergio Plasencia user 03 Dec 2015 at 10:38 a.m. CST

6 Responses
Sergio Plasencia gravatar
Hello, We are trying to define an authentication script. Basically, we just need the user to introduce an extra field in the login page. This field is an account_id that we just included in the /opt/apache-tomcat-7.0.55/webapps/oxauth/login.xhtml file. We just added this (before the username field defintion): <h:outputLabel for="accountID" value="Account ID"/> <h:inputText id="accountID" value="" autocomplete="off"/> <h:outputText value=""/> Then, we are using a basic Sample Authentication script in order to use this parameter. We want the username to become "accountid+username". We added the following code to the script (right after user_password = credentials.getPassword()): account_id = requestParameters.get("accountID") user_name = account_id + user_name It does not work. We get: TypeError: unsupported operand type(s) for +: 'NoneType' and 'unicode' I guess that requestParameters.get("accountID") does not return anything. How can we achieve that? Thank you very much in advance.

By Sergio Plasencia user 11 Dec 2015 at 8:50 a.m. CST

Sergio Plasencia gravatar
Hi, Do you happen to have any update on this? We will appreciate some kind of guidance here as we are stuck for few days already and the documentation about it is not deep enough. Also, debugging jython is difficult as print statements are not being written in the wrapper.log file for some reason. Thank you very much in advance.

By Mohib Zico Account Admin 17 Dec 2015 at 1:09 a.m. CST

Mohib Zico gravatar
>> It does not work. We get: TypeError: unsupported operand type(s) for +: 'NoneType' and 'unicode' This is a python error. Check your custom script.

By Sergio Plasencia user 18 Dec 2015 at 5:48 a.m. CST

Sergio Plasencia gravatar
We know it is just a python error but our main problem is that we can't debug properly because print statements does not logged into the wrapper.log file.

By Mohib Zico Account Admin 18 Dec 2015 at 6:07 a.m. CST

Mohib Zico gravatar
Check oxauth_script.log and oxtrust_script.log inside /opt/tomcat/logs/

By Sergio Plasencia user 18 Dec 2015 at 6:51 a.m. CST

Sergio Plasencia gravatar
Great. Indeed it was being logged into oxauth_script.log We get nothing from this call: requestParameters.get("accountID") I guess this is not the right way. Is there any way to retrieve a form parameter in custom scripts?

By Sergio Plasencia user 18 Dec 2015 at 10 a.m. CST

Sergio Plasencia gravatar
We managed to make it works!! The right way is like this: requestParameters.get("loginForm:accountID")[0] You can close the ticket. Thanks!!