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.
B758fc0291e995b116b3f4c57b087889?d=identicon&s=25 Stefan Magnus Landrø (Guest)
on 2009-02-04 12: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
7c02e94043800ebd486cc25963a47b81?d=identicon&s=25 Jan Berkel (Guest)
on 2009-02-04 13: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.
B758fc0291e995b116b3f4c57b087889?d=identicon&s=25 Stefan Magnus Landrø (Guest)
on 2009-02-04 13: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 Berkel <jan.berkel@gmail.com>
E74f893420b8eda081bc6a721420fa38?d=identicon&s=25 Darcy Schultz (Guest)
on 2009-02-04 14: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')
526d60de6472502bb570a9df2842b33b?d=identicon&s=25 Nick Sieger (Guest)
on 2009-02-04 16:43
(Received via mailing list)
On Wed, Feb 4, 2009 at 7:30 AM, Darcy Schultz <schuldar@gmail.com>
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.