Login  Register

RE: Re: RE: Re: <p:param type="input" name="instance"/>

Posted by smaran on Mar 07, 2011; 10:20am
URL: https://discuss.orbeon.com/p-param-type-input-name-instance-tp3338458p3338656.html

Hi,
I use the sample application '/java-authentication/' for user authentication.

________________________________________
tomcat-user.xml (Users in Tomcat)

<tomcat-users>
    <role rolename="orbeon-admin"/>
    <user name="orbeon" password="orbeon" roles="orbeon-admin"/>
</tomcat-users>
________________________________________
web.xml

...
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Orbeon Builder</web-resource-name>
            <url-pattern>/fr/orbeon/builder/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>orbeon-admin</role-name>
        </auth-constraint>
    </security-constraint>
       
    <login-config>
        <auth-method>FORM</auth-method>
        <form-login-config>
            <form-login-page>/java-authentication/login</form-login-page>
            <form-error-page>/java-authentication/login-error</form-error-page>
        </form-login-config>
    </login-config>
       
    <security-role>
        <role-name>orbeon-admin</role-name>
    </security-role>
...

Trying to access the list of forms of 'Orbeon Builder' (which is shown by 'Orbeon Runner') http://[localhost]/orbeon/fr/orbeon/builder/summary, goes to the authentication form in the url '/java-authentication/', right, is the expected behavior, once authenticated, is once again the summary page of 'Orbeon Builder ".

- Image: Login Form by the app '/java-authentication/
- Image: User info displayed by the app '/java-authentication/'
- Image: Session in Tomcat for the user authenticated (smaran)
- Image: Details of the session in Tomcat for the user

So far all right, but although there is an authenticated user in the context '/ orbeon' in Tomcat, 'Form Runner' or 'Form Builder' shows no reference to the user, or when you create or modify forms, data is not saved user in the 'USERNAME' table 'ORBEON_FORM_DATA', which remains empty although there is an authenticated user.

Why this is happening.
Regards,
Smaran

-----Original Message-----
From: Florian Schmitt [mailto:[hidden email]]
Sent: Monday, March 07, 2011 3:38 PM
To: [hidden email]
Subject: [ops-users] Re: RE: Re: <p:param type="input" name="instance"/>

Smaran,

> Can you tell me
> <xforms:action if="xxforms:property('oxf.fr.authentication.method') = 'container'">
>             <!-- Case where we get the username and roles from the container -->
>             <xforms:setvalue ref="instance('fr-authentication-headers')/header[@name = 'username']/@value" value="xxforms:get-remote-user()"/>
>             <xforms:message level="xxforms:log-debug">Roles: <xforms:output value="xxforms:property('oxf.fr.authentication.container.roles')"/></xforms:message>
>             <xforms:action xxforms:iterate="tokenize(xxforms:property('oxf.fr.authentication.container.roles'), '\s+')">
>                 <xxforms:variable name="role" select="."/>
>                 <xforms:action if="xxforms:is-user-in-role($role)">
>                     <xforms:setvalue ref="instance('fr-authentication-headers')/header[@name = 'roles']/@value" value="if (. = '') then $role else concat(., ' ', $role)"/>
>                 </xforms:action>
>             </xforms:action>
>         </xforms:action>
>
>
> From where the username its expecting
i suppose the important line is

<xforms:setvalue ref="instance('fr-authentication-headers')/header[@name
= 'username']/@value" value="xxforms:get-remote-user()"/>

It tries to determine the user using the function xxforms:get-remote-user(). (1)

If the function doesn't return a user name, it's most likely that the request doesn't contain authentication data, maybe because the requested resource didn't require authentication. So, to narrow down the problem i would start with the tomcat configuration - is authentication set up correctly, does the request fail if no authentication information is given? Using, for example, an AccessLogValve (2) could be useful to determine if a remote user was authenticated (using u%).

HTH
florian

(1)
http://wiki.orbeon.com/forms/doc/developer-guide/xforms-xpath-functions#TOC-xxforms:get-remote-user-
(2)
http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html#Access_Log_Valve



Please do not print this email unless it is absolutely necessary.

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws