Logging in authenticated users

Discussion in 'PHP' started by ismartinez, Nov 28, 2007.

  1. #1
    Hi,
    I am a newbie, and I would like to know:

    - how could I allow visitors, previously authenticated on a domain, to automatically login to a website without administrative permission on that domain.
    - how could I know which authenticated user on a domain in visiting my website

    thanks in advance.
     
    ismartinez, Nov 28, 2007 IP
  2. vonvhen

    vonvhen Peon

    Messages:
    152
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    1- You can use cookies
    2- You would need to some how save the user's info (database/text file)
     
    vonvhen, Nov 28, 2007 IP
  3. Jackel.ca

    Jackel.ca Well-Known Member

    Messages:
    108
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #3
    Make use of both sessions and cookies, or atleast sessions. ;)
     
    Jackel.ca, Nov 28, 2007 IP
  4. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #4
    your script must get the IP of the user and store it into the database and into a session...... I think getting the IP of the user is the best way to authenticate the session... ^^,
     
    bartolay13, Nov 28, 2007 IP
  5. tonybogs

    tonybogs Peon

    Messages:
    462
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #5
    The IP is not a good approach because not everyones IP is static. THis is especially the case for wireless connections where the IP can fluctuate causing your user to be logged out.

    You will definetely need to use sessions or cookies for this, as for authentication i usually use:-
    - Some unique id for that user generated when they sign up for the first time
    - the user agent
    - some 'salt' which is a random string assigned to the user when they log in.
    concatenate all that together and md5 it and you have a security check that is very very hard to crack.

    Hope this helps
     
    tonybogs, Nov 29, 2007 IP
  6. ismartinez

    ismartinez Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Perhaps, I was not crystal clear or I am so dumb that don't understand your answers.
    I am trying to implementing an website running on a LAN intranet. That website won't be on the LAN domain, but on my pc. What I want is that only the users authenticated to the LAN Domain are allow to see my website.
    I am just trying to avoid a double checking in.
    The problem is that I don't know how to query the LAN domain to ask it if a user is an authenticated one.
     
    ismartinez, Nov 29, 2007 IP