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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Oct 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Password protected content

    I have some trouble with access to password protected content.

    My webserver is set to ask for a user and password using .htaccess and .htpasswd. This works absolutely fine, when I access my webserver through http://localhost/.

    But when other people access through an external IP, they have to re-authenticate every time they click a new link, or access a different file. This is disastrous because I'm encorporating this into a program which can't handle being asked for user/pw every 5 seconds! (apache)

    .htaccess:

    Code:
    AuthName "Secure Area"
    AuthType Basic
    AuthUserFile D:\.htpasswd
    require valid-user

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    This sounds like the browser itself is not configured to retain any information about the authorization for the realm, or that the realm itself is changing.
    You are using a static ip address for this without NAT?
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #3
    New to the CF scene
    Join Date
    Oct 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fou-Lu View Post
    This sounds like the browser itself is not configured to retain any information about the authorization for the realm, or that the realm itself is changing.
    You are using a static ip address for this without NAT?
    Hello
    Thank you for replying to me,

    Technically the browser is the same. I tried once with localhost, (working fine), and secondly with the hamachi IP address (incase you dont know what hamachi is, its a quick and simple way of making a VPN for others to test my program) same browser, I try with 2 different IPs, and with localhost I can browse until I close the browser, and with the hamachi IP, every time I open a new link on the server, I need to re-authenticate...

    Thanks in advance.

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Check your access logs, I'm curious if the IP is changing. You should be able to tell based on the access request ip/port.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #5
    New to the CF scene
    Join Date
    Oct 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello, thanks again for replying:

    Here is an sample of the access logs:

    25.1**.63.174 - - [28/Oct/2013:22:13:17 +0100] "GET /sample_file1.mp3 HTTP/1.1" 401 401
    25.22.**0.150 - - [28/Oct/2013:22:14:29 +0100] "GET /sample_file2.mp3 HTTP/1.1" 401 401
    25.22.**0.150 - - [28/Oct/2013:22:14:30 +0100] "GET /sample_file2.mp3 HTTP/1.1" 401 401
    25.22.**0.150 - tom [28/Oct/2013:22:14:30 +0100] "GET /sample_file1.mp3 HTTP/1.1" 404 210
    25.22.**0.150 - tom [28/Oct/2013:22:14:30 +0100] "GET /sample_file3.mp3 HTTP/1.1" 200 12525365
    25.22.**0.150 - - [28/Oct/2013:22:15:17 +0100] "GET /sample_file1.mp3 HTTP/1.1" 401 401
    25.22.**0.150 - - [28/Oct/2013:22:15:17 +0100] "GET /sample_file1.mp3 HTTP/1.1" 401 401
    25.22.**0.150 - tom [28/Oct/2013:22:15:17 +0100] "GET /sample_file2.mp3 HTTP/1.1" 200 7797354
    25.22.**0.150 - tom [28/Oct/2013:22:15:19 +0100] "GET /sample_file1.mp3 HTTP/1.1" 404 217
    25.1**.63.174 - tom [28/Oct/2013:22:13:19 +0100] "GET /sample_file1.mp3 HTTP/1.1" 200 8038722
    25.22.**0.150 - tom [28/Oct/2013:22:15:19 +0100] "GET /sample_file3.mp3 HTTP/1.1" 200 7797354
    25.22.**0.150 - - [28/Oct/2013:22:42:20 +0100] "GET /sample_file3.mp3 HTTP/1.1" 401 401
    25.22.**0.150 - tom [28/Oct/2013:22:42:22 +0100] "GET/sample_file3.mp3 HTTP/1.1" 404 230
    25.1**.63.174 - - [28/Oct/2013:22:42:27 +0100] "GET/sample_file3.mp3 HTTP/1.1" 401 401
    25.22.**0.150- tom [28/Oct/2013:22:42:22 +0100] "GET /sample_file3.mp3 HTTP/1.1" 200 10156544
    25.1**.63.174 - tom [28/Oct/2013:22:42:29 +0100] "GET /sample_file1.mp3 HTTP/1.1" 200 9634944

    The two IPs displayed are me and my friend both accessing the files, the same thing happens to us both.

    "tom" is the username we access the fileserver with.

    This is all a bit new to me I'm afraid.


    Thank you.

  • #6
    New Coder
    Join Date
    Dec 2013
    Posts
    26
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Would you mind bring the configuration of your server and also if you are using a control panel


  •  

    LinkBacks (?)


    Posting Permissions

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