Forum: JRuby Calling methods on HttpServletRequest from a rails app

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Stefan Magnus Landrø (Guest)
on 2009-02-04 13:01
(Received via mailing list)
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
Jan B. (Guest)
on 2009-02-04 14:29
(Received via mailing list)
you shouldn't need to - getRemoteUser() etc. all rely on standard HTTP
headers (REMOTE_USER) which should be accessible from rails.
Stefan Magnus Landrø (Guest)
on 2009-02-04 14:44
(Received via mailing list)
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>
Darcy S. (Guest)
on 2009-02-04 15:31
(Received via mailing list)
From memory (so I could be wrong) you would do something like this:

request['java.servlet_request'].is_user_in_role('Admin')
Nick S. (Guest)
on 2009-02-04 17:43
(Received via mailing list)
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
This topic is locked and can not be replied to.