Need to access J2EE security info in Rails App
----------------------------------------------
Key: JRUBY-2416
URL: http://jira.codehaus.org/browse/JRUBY-2416
Project: JRuby
Issue Type: Bug
Components: GoldSpike, Java Integration, JRuby-extras
Affects Versions: JRuby 1.1
Environment: running on:
Tomcat 6.0.16 (tried 5.5 as well)
Java 1.6.0_05 (64bit) on Linux (Sun implementation)
Java 1.6.0_04 (32bit) on Windows (Sub implementation)
Reporter: Eric Gascoine
App needs to take advantage of the Web security components in the Servlet
container (facilitates Single Sign on in a way JRuby can't in this environment).
Like to have access the the request.getUserPrincipal and
request.isUserInRole(String) methods.
Ruby returns nil and false respectively regardless of the fact that the servlet
container has authenticated user.
Web.xml fragment:
<security-constraint>
<display-name>The application</display-name>
<web-resource-collection>
<web-resource-name>The Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>view</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>CLIENT-CERT</auth-method>
</login-config>
<security-role>
<description>viewer</description>
<role-name>view</role-name>
</security-role>
Code Fragment in view
<%= h $java_servlet_request.userPrincipal.inspect %> <br/>
<%= h $java_servlet_request.remoteUser.inspect %> <br/>
Both return the string 'nil' of course
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email