dcsimg
www.webdeveloper.com
Results 1 to 8 of 8

Thread: Get current logged-in windows user in google chrome

  1. #1
    Join Date
    Jun 2012
    Posts
    6

    Get current logged-in windows user in google chrome

    Hello everyone, I have a question for you: I have built a web
    application, until now, used it only with internet explorer. I'm now
    want to make it usable in google chrome as well, but there is one
    thing I can't work out yet: In my javascript code, I've used an
    ActiveX object in order to fetch the current logged in windows user.
    As I know, ActiveX will not work on google chrome, but my question is
    if there is an alternative way in order to fetch the current user in
    google chrome.
    Thanks in advanced,
    Tal Tchernihovski,
    taltcher@gmail.com

  2. #2
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    If you're trying to authenticate folks using their windows (Active Directory) accounts in the local domain, you'll want to just use Windows Authentication (NTML). This is as simple as checking a few boxes if you're running .NET/IIS. Chrome (and IE, of course) should correctly authenticate user's behind the scenes, making usernames available server-side, which can then be sent client-side as-needed.

  3. #3
    Join Date
    Jun 2012
    Posts
    6

    Thanks for the answer

    First I would like to thank you for the answer, can you give me example or explenation how do I do it?

  4. #4
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    So, you are writing an ASP.NET app, to be hosted on the local domain?

  5. #5
    Join Date
    Jun 2012
    Posts
    6

    replay

    no, I'm not writing aspx pages, this is html pages hosted application

  6. #6
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    Quote Originally Posted by taltcher View Post
    no, I'm not writing aspx pages, this is html pages hosted application
    If you've got no server-side executed code, I don't think you'll be able to get what you want. But, it leads me to wonder, why do you need the client's username if you're not doing anything with it server-side?

  7. #7
    Join Date
    Jun 2012
    Posts
    6

    replay

    I'll explain to you: until now, on internet explorer I used WScript.Network
    ActiveX object, and after I fetched the user name, I called a web service with soap request which giving me all the groups which the user belongs to.

    So I wondered if there is similar way to fetch the user name in google chrome browser.

  8. #8
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    The only way I know to accomplish this is to enable NTLM on the web-service, and rather than have the webservice accept a username as a parameter, pick it up using the NTLM-authorized user object. (I'm not sure offhand what the code looks like to do this.) The only safe alternative, I think, is to ask the user to enter some credentials.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles