windows username of user

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

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:

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?

Peter Armstrong

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 ( You can download
its MIT-licensed source code for free from to see
how this works, regardless of whether you buy the book...