Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New to the CF scene
    Join Date
    Jul 2014
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Retrieve visitor's windows login

    Hi, seems most of the answer online are geared to ASP.NET via the use of following.
    Code:
    HttpContext.Current.User.Identity.Name
    But can the same be done with a Java solution whether it is via jQuery or JSP code or Controller on the server side? Thanks.
    I tried reading Apach Shiro to see if they have a solution but it appears to be not very straight forward.

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,710
    Thanks
    25
    Thanked 660 Times in 659 Posts
    What is the question?
    Are you trying to get the users name?
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • #3
    New to the CF scene
    Join Date
    Jul 2014
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by sunfighter View Post
    What is the question?
    Are you trying to get the users name?
    Hi, sorry for not being specific. But yes that's what I'm trying to do. Also once I have gotten the user login name, is there a way to verify it against LDAP or AD if it's inside a corporate environment?

  • #4
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,710
    Thanks
    25
    Thanked 660 Times in 659 Posts
    Are you the web site manager/programmer or a third party?
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • #5
    New to the CF scene
    Join Date
    Jul 2014
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by sunfighter View Post
    Are you the web site manager/programmer or a third party?
    I own the site, am the programmer.

  • #6
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,710
    Thanks
    25
    Thanked 660 Times in 659 Posts
    When a user logs in they do it by entering their password and either their user name or their e-mail address. If the former you have it right there, if the latter their user name should be in the DB and you retrieve it from there. You can use a cookie to keep track of him/her or a sessions variable or both.

    Verification of the user name is done at log in.

    Did this help or am I way off base as to your needs?
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • #7
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,927
    Thanks
    6
    Thanked 1,040 Times in 1,013 Posts
    Quote Originally Posted by grob115 View Post
    can the same be done with a Java solution whether it is via jQuery or JSP code […]
    jQuery and JSP have absolutely nothing to do with each other. In any case, this thread doesn’t belong into the HTML/CSS forum. I suppose this rather belongs into the Java and JSP forum.

  • #8
    New to the CF scene
    Join Date
    Jul 2014
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by sunfighter View Post
    When a user logs in they do it by entering their password and either their user name or their e-mail address. If the former you have it right there, if the latter their user name should be in the DB and you retrieve it from there. You can use a cookie to keep track of him/her or a sessions variable or both.

    Verification of the user name is done at log in.

    Did this help or am I way off base as to your needs?
    Sorry this is off. I'm not looking at say for example someone logging into a community site like this. I'm looking for a way to retrieve the username as logged into the PC.

  • #9
    New to the CF scene
    Join Date
    Jul 2014
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by VIPStephan View Post
    jQuery and JSP have absolutely nothing to do with each other. In any case, this thread doesn’t belong into the HTML/CSS forum. I suppose this rather belongs into the Java and JSP forum.
    Sorry yes it may not be. Was wondering if there are anything available from the OS exposing to the browser that Javascript framework like JQuery can pick up. So much so you can use Javascript to find out the user's operating system via the browser, wondering if the same exists for the logged in name. Say this is only possible with server side technology like Java, how can this be done?

  • #10
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,928
    Thanks
    46
    Thanked 203 Times in 202 Posts
    Quote Originally Posted by grob115 View Post
    Sorry this is off. I'm not looking at say for example someone logging into a community site like this. I'm looking for a way to retrieve the username as logged into the PC.
    That is NT authentication, not session variable of user info for a web session. Start here

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE


  •  

    Posting Permissions

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