Forum: Ruby on Rails windows username of user

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.
Aman T. (Guest)
on 2007-01-24 08:14
Hello,

I am writing a Ruby on Rails application with Flex as the front end.

The RoR is installed on linux and Flash UI interacting with Rails via
HTTPService is running on Windows.

I need to find the windows loginname of the user using my application to
perform some basic authentication, and perhaps display Hello <username>
too. :)

Could you please let me know how that could be made possible.

Many Thanks in advance,
Aman
Peter A. (Guest)
on 2007-01-24 09:00
(Received via mailing list)
Hi Aman,

I don't know how to do it from Flash (and thus Flex).  I doubt it's
possible to do in straight ActionScript.  That said, if it is possible
to use JavaScript to get it, you can have JavaScript get it and then
tell Flex via the Flex-Ajax Bridge
(http://labs.adobe.com/wiki/index.php/Flex_Framework:FABridge).

Since I'm not a JavaScript / ActiveX guru, I don't know if this is
possible.  One solution I have seen from googling is here:
http://www.codingforums.com/archive/index.php?t-5057.html

That said, why don't you just use a standard login system (e.g.
login_generator, acts_as_authenticated, restful_authentication) on the
Rails side (or roll your own, as is done in AWDwR) rather than trying
to get the Windows login name from Flex?

This would be more reliable than relying on JavaScript (which the user
may have disabled) and IE (since I assume that the ActiveX solution
shown at codingforums is IE-only).  Furthermore, why limit yourself to
Windows clients when you can support Mac clients as well with *less*
effort on your part?

Cheers,
Peter A.

P.S. Shameless plug: I have examples of Flex talking to Rails--both
using login_generator and using restful_authentication--in my PDF-only
book Flexible Rails (http://www.flexiblerails.com).  You can download
its MIT-licensed source code for free from
http://www.flexiblerails.com/files/FlexibleRailsBookCode.zip to see
how this works, regardless of whether you buy the book...
Aman T. (Guest)
on 2007-01-24 09:35
Thank you so much Peter!

Yes I've confirmed that Flash can not provide the windows loginname to
me.

I was bent on acquiring the windows username for authentication as I do
not want to prompt the user for a username or password.

The list of users allowed to operate the application is very small and
can be authenticated against their windows id to mimic a single-signon.

Do you think solutions like Net::LDAP or login_generator could fit the
bill?

Many Thanks,
Aman
neongrau _. (Guest)
on 2007-01-24 13:53
Aman Thind wrote:
> Thank you so much Peter!
>
> Yes I've confirmed that Flash can not provide the windows loginname to
> me.
>
> I was bent on acquiring the windows username for authentication as I do
> not want to prompt the user for a username or password.
>
> The list of users allowed to operate the application is very small and
> can be authenticated against their windows id to mimic a single-signon.
>
> Do you think solutions like Net::LDAP or login_generator could fit the
> bill?

when i was trying to find a way to use windows authentication, the only
way i could find was by using a webserver that itself understands
windows-auth (so IIS for me). and then proxy the requests to mongrel(s)
(or whatever server runs your rails app).

see my post with a little howto at http://www.ruby-forum.com/topic/91247

perhaps this helps,

ralf
This topic is locked and can not be replied to.