Calling methods on HttpServletRequest from a rails app

Is there a way to call methods on the httpservletrequest from a jruby on
rails app?

I’m particularly interested in:

getRemoteUser()
isUserInRole()
getPrincipal()

Because we want to integrate a rails app in an SSO environment.

Stefan

you shouldn’t need to - getRemoteUser() etc. all rely on standard HTTP
headers (REMOTE_USER) which should be accessible from rails.

Well, remote user should be no issue, but I believe isUserInRole
performs a
check in the security provider (e.g. LDAP ) to check what groups the
user is
a member of and then J2EE security kicks in and turns the group info
into a
role.

2009/2/4 Jan B. [email protected]

From memory (so I could be wrong) you would do something like this:

request[‘java.servlet_request’].is_user_in_role(‘Admin’)

On Wed, Feb 4, 2009 at 7:30 AM, Darcy S. [email protected]
wrote:

From memory (so I could be wrong) you would do something like this:
request[‘java.servlet_request’].is_user_in_role(‘Admin’)

Or simply #servlet_request as of JRuby-Rack 0.9.

def index
servlet_request.is_user_in_role(…)
end

/Nick

headers (REMOTE_USER) which should be accessible from rails.


Bekk Open Source
http://boss.bekk.no


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email