473,395 Members | 1,689 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Authentication?

Hello,

Is this kind of code much used for authentication?
...
if (!isset($_SERVER["PHP_AUTH_USER"])) {
header('WWW-Authenticate: Basic realm="Log in"');
header("HTTP/1.0 401 Unauthorized");
....

I have tried to play with it and downloaded a lot of codeexamples. I find
it hard
to control when I am logged in and when I am logged out. I can log out and
it seems
like it also, but when I do a refresh on my page am am logged in again.

Maybe I have missed something and that is why I dont get it to work
properly.
But would it be better to create my own form for logging in and have more
control? I guess
I would have control doing that.
- Terje

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jul 17 '05 #1
3 1599
In article <op**************@news.Individual.net>,
teho <te******@broadpark.no> wrote:
Hello,

Is this kind of code much used for authentication?
...
if (!isset($_SERVER["PHP_AUTH_USER"])) {
header('WWW-Authenticate: Basic realm="Log in"');
header("HTTP/1.0 401 Unauthorized");
....

I have tried to play with it and downloaded a lot of codeexamples. I find
it hard
to control when I am logged in and when I am logged out. I can log out and
it seems
like it also, but when I do a refresh on my page am am logged in again.

Maybe I have missed something and that is why I dont get it to work
properly.


The problem with $_SERVER['PHP_AUTH_USER'] is that once it is set, it's
not possible to unset it, except by quitting the browser. I use it for
simple access control, only when logging out of the application is not
needed. If you need logging out, it's a better idea to create your own
session variables for managing authentication.

JP

--
Sorry, <de*****@cauce.org> is een "spam trap".
E-mail adres is <jpk"at"akamail.com>, waarbij "at" = @.
Jul 17 '05 #2
On Thu, 29 Apr 2004 16:46:43 +0200, Jan Pieter Kunst <de*****@cauce.org>
wrote:
In article <op**************@news.Individual.net>,
teho <te******@broadpark.no> wrote:
Hello,

Is this kind of code much used for authentication?
...
if (!isset($_SERVER["PHP_AUTH_USER"])) {
header('WWW-Authenticate: Basic realm="Log in"');
header("HTTP/1.0 401 Unauthorized");
....

I have tried to play with it and downloaded a lot of codeexamples. I
find
it hard
to control when I am logged in and when I am logged out. I can log out
and
it seems
like it also, but when I do a refresh on my page am am logged in again.

Maybe I have missed something and that is why I dont get it to work
properly.


The problem with $_SERVER['PHP_AUTH_USER'] is that once it is set, it's
not possible to unset it, except by quitting the browser. I use it for
simple access control, only when logging out of the application is not
needed. If you need logging out, it's a better idea to create your own
session variables for managing authentication.

JP


Thanks!

What you say here corresponds to what I am struggeling with, trying
to unset PHP_AUTH_USER.

Fine, I will write my own login then.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jul 17 '05 #3

"teho" <te******@broadpark.no> wrote in message
news:op**************@news.Individual.net...
Thanks!

What you say here corresponds to what I am struggeling with, trying
to unset PHP_AUTH_USER.

Fine, I will write my own login then.


Well, you could use PEAR:Auth and/or PEAR:LiveUser instead of rolling your
own.

Just a thought

Walter
http://web.torres.ws
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. #...
8
by: Bob Everland | last post by:
I have an application that is ISAPI and the only way to secure it is through NT permissions. I need to have a way to login to windows authentication so that when I get to the ISAPI application no...
6
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms...
9
by: Tom B | last post by:
In my web.config file I've specified Windows for the authentication, in IIS I've set it to Integrated Authentication. But my SQL connection is still showing Anonymous. Is there somewhere else I...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
4
by: Andrew | last post by:
Hey all, I would like to preface my question by stating I am still learning ASP.net and while I am confident in the basics and foundation, the more advanced stuff is still a challenge. Ok....
0
by: Albertas | last post by:
What I'm doing wrong that I can't make my authentication to work. Here is the situation: I'm hosting a Web Service from a Windows forms application, using .NET Framework 3.0 WCF. And I want to...
18
by: troywalker | last post by:
I am new to LDAP and Directory Services, and I have a project that requires me to authenticate users against a Sun Java System Directory Server in order to access the application. I have found...
2
by: Frank Swarbrick | last post by:
I am trying to understand "client authentication" works. My environment is DB2/UDB LUW 8.2 on zSeries SLES9 as the database server and DB2 for VSE 7.4 as the client. We currently have DB2/LUW set...
5
by: Rory Becker | last post by:
Having now created a Custom MembershipProvider that seems to work correctly with my Logon and ChangePassword controls, I am, as they say, a happy bunny. The next stange is to move on to the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.