HTTP-auth workaround

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default HTTP-auth workaround

    I'm looking for a way to force basic http autentication from within a PHP
    script.

    Here's the situation:

    I have an exisiting system that first authenticates people via the aMemberPro
    package. In the "old days", aMemberPro then moved the user to a page inside a
    directory protected with .htaccess basic authentication. It used the URL
    format [url]http://name:password@server.directory.page.html[/url]. When the IE6 update
    came out, this syntax no longer worked.

    As a workaround, the "name:password@" was removed. Now, users have to login to
    the aMemberPro page then login again to the protected content of the website.

    I have access to the userid and password. Is there a way that I can set things
    up right before the user is redirected to the server/directory/page.html
    inside the protected directory so the web server's authentication will be
    satisifed and the user will not be prompted again for userid/password?

    I've tried plugging values for $_SERVER[remote_user], but I still get prompted
    by the server for userid/password.

    Thanks for any suggestions.
    Steven Stern Guest

  2. Similar Questions and Discussions

    1. WS using HTTP-POST auth
      How can I call web service using HTTP-POST in asp.net where on the server side is windows authentification required? thank you, Jure
    2. HTTP Auth Logout (asp)
      Is there a way to clear or reset an authenticated user so that the next visitor using the same machine (without having to close the browser) has to...
    3. How do i use HTTP Auth. in IIS
      Could someone please help me to understand how i can use http authentication with IIS? I would like to know if there is a way that i can use the...
    4. downloadnetthing with http auth
      Anybody know if downloadnetthing() is supposed to work with net things that are "protected" by basic http authentication? If I try a url like...
    5. note 2812 deleted from features.http-auth by alindeman
      Note Submitter: auke@muze.nl ---- Someone gave me a simple solution to the 'logout' problem: add some sort of timestamp to the basic realm you...
  3. #2

    Default Re: HTTP-auth workaround

    Steven Stern wrote:
    > Here's the situation:
    >
    > I have an exisiting system that first authenticates people via the aMemberPro
    > package. In the "old days", aMemberPro then moved the user to a page inside a
    > directory protected with .htaccess basic authentication. It used the URL
    > format [url]http://name:password@server.directory.page.html[/url]. When the IE6 update
    > came out, this syntax no longer worked.
    >
    > As a workaround, the "name:password@" was removed. Now, users have to login to
    > the aMemberPro page then login again to the protected content of the website.
    >
    > I have access to the userid and password. Is there a way that I can set things
    > up right before the user is redirected to the server/directory/page.html
    > inside the protected directory so the web server's authentication will be
    > satisifed and the user will not be prompted again for userid/password?
    >
    > I've tried plugging values for $_SERVER[remote_user], but I still get prompted
    > by the server for userid/password.
    >
    > Thanks for any suggestions.
    One possibility is not to actually direct over there. Use a wrapper
    script to get the page content and display it based on the user/pass
    already used.

    For instance, write a script that does something like:

    readfile('http://'.$username.':'.$password.'@www.example.com/dir/file.html');

    So what you'd do is redirect to this page, get the user/pass, add it to
    the above line, and end the script. If you want the user to click
    through links in the pages there, your best bet is to have them just log
    in a second time...

    Hmm... a better solution is to use the Basic Auth as the login in the
    first place, even if you want to use PHP to do it:

    [url]http://us2.php.net/features.http-auth[/url]

    --
    Justin Koivisto - [email]spam@koivi.com[/email]
    PHP POSTERS: Please use comp.lang.php for PHP related questions,
    alt.php* groups are not recommended.
    Justin Koivisto Guest

  4. #3

    Default Re: HTTP-auth workaround

    On Tue, 27 Apr 2004 18:25:45 GMT (more or less), Justin Koivisto
    <spam@koivi.com> wrote:
    >Hmm... a better solution is to use the Basic Auth as the login in the
    >first place, even if you want to use PHP to do it:
    >
    >[url]http://us2.php.net/features.http-auth[/url]
    That's where I started. I may yet wind up re-writing things so I get the
    id/psw, check it against aMember's database, then go on with the http-auth
    login. My hope is that I can do this with the minumum modification to
    existing code. It's a website I inherited and I don't have a complete
    understanding (yet) of how the aMember system works.
    Steven Stern Guest

  5. #4

    Default Re: HTTP-auth workaround

    Steven Stern wrote:
    > I'm looking for a way to force basic http autentication from within a PHP
    > script.
    >
    And here it is
    [url]http://www.php.net/manual/en/features.http-auth.php[/url]
    Terence Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139