Calling methods on HttpServletRequest from a rails app


#1

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


#2

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


#3

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. removed_email_address@domain.invalid


#4

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

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


#5

On Wed, Feb 4, 2009 at 7:30 AM, Darcy S. removed_email_address@domain.invalid
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