getting authentication information from apache - PHP
This is a discussion on getting authentication information from apache - PHP ; Hello,
I'm new to php and I have am running php on apache. I already have ldap
authentication set up in apache would rather not create a separate system
for php. What would be ideal would be to get the ...
-
getting authentication information from apache
Hello,
I'm new to php and I have am running php on apache. I already have ldap
authentication set up in apache would rather not create a separate system
for php. What would be ideal would be to get the current authenticated user
from the apache environment. At this point I'm grabbing at straws, but so
far I've tried....
$ret = apache_getenv("LDAP_USER");
echo $ret;
echo $_SERVER['REMOTE_USER'];
echo $_SERVER['PHP_AUTH_DIGEST'];
$ret = apache_getenv('PHP_AUTH_DIGEST');
None of these work. Has anyone done this??
Thanks,
Ryan
-
getting authentication information from apache
Hello,
I'm new to php and I have am running php on apache. I already have ldap
authentication set up in apache would rather not create a separate system
for php. What would be ideal would be to get the current authenticated user
from the apache environment. At this point I'm grabbing at straws, but so
far I've tried....
$ret = apache_getenv("LDAP_USER");
echo $ret;
echo $_SERVER['PHP_AUTH_DIGEST'];
$ret = apache_getenv('PHP_AUTH_DIGEST');
echo $HTTP_SERVER_VARS['PHP_AUTH_USER'];
echo $_SERVER['REMOTE_USER'];
None of these work (all of the variables are empty). Has anyone done this??
Thanks,
Ryan
-
Re: [PHP] getting authentication information from apache
Ryan wrote:
> Hello,
>
> I'm new to php and I have am running php on apache. I already have ldap
> authentication set up in apache would rather not create a separate system
> for php. What would be ideal would be to get the current authenticated user
> from the apache environment. At this point I'm grabbing at straws, but so
> far I've tried....
>
> $ret = apache_getenv("LDAP_USER");
> echo $ret;
> echo $_SERVER['REMOTE_USER'];
> echo $_SERVER['PHP_AUTH_DIGEST'];
> $ret = apache_getenv('PHP_AUTH_DIGEST');
does this offer any clue?:
var_dump($_ENV, $_SERVER);
>
> None of these work. Has anyone done this??
>
> Thanks,
> Ryan
>
-
Re: [PHP] getting authentication information from apache
Jochem,
Hmm, not sure what I'm looking for, but from what I've read, the
REMOTE_USER should contain this informaion, mine seems to be empty.
array(30) {
-
Re: [PHP] getting authentication information from apache
Jochem,
Hmm, not sure what I'm looking for, but from what I've read, the
REMOTE_USER should contain this informaion, mine seems to be empty.
array(30) {
-
Re: [PHP] getting authentication information from apache
On Wed, February 21, 2007 1:01 pm, Ryan wrote:
> I'm new to php and I have am running php on apache. I already have
> ldap
> authentication set up in apache would rather not create a separate
> system
> for php. What would be ideal would be to get the current authenticated
> user
> from the apache environment. At this point I'm grabbing at straws, but
> so
> far I've tried....
>
> $ret = apache_getenv("LDAP_USER");
> echo $ret;
> echo $_SERVER['REMOTE_USER'];
> echo $_SERVER['PHP_AUTH_DIGEST'];
> $ret = apache_getenv('PHP_AUTH_DIGEST');
>
> None of these work. Has anyone done this??
If the answer you are seeking isn't available in:
<?php phpinfo();?>
run on the page where you are trying to do this, then you probably
can't get the answer you want.
Running http://php.net/ldap to re-connect and re-authenticate will
probably be fairly cheap, since LDAP is supposed to be pretty dang
fast in the first place, and whatever caching is going on for the LDAP
or OS calls behind LDAP virtually guarantees that the data you want is
in RAM.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
-
Re: [PHP] getting authentication information from apache
Richard,
I looked at phpinfo() as you said, same thing...
_SERVER["REMOTE_USER"] no value
You may be right, this may not be available, but I don't want to keep
throwing a login screen in front of users for no apparent reason.
Thanks,
Ryan
On 2/23/07, Richard Lynch <ceo@l-i-e.com> wrote:
> On Wed, February 21, 2007 1:01 pm, Ryan wrote:
> > I'm new to php and I have am running php on apache. I already have
> > ldap
> > authentication set up in apache would rather not create a separate
> > system
> > for php. What would be ideal would be to get the current authenticated
> > user
> > from the apache environment. At this point I'm grabbing at straws, but
> > so
> > far I've tried....
> >
> > $ret = apache_getenv("LDAP_USER");
> > echo $ret;
> > echo $_SERVER['REMOTE_USER'];
> > echo $_SERVER['PHP_AUTH_DIGEST'];
> > $ret = apache_getenv('PHP_AUTH_DIGEST');
> >
> > None of these work. Has anyone done this??
>
> If the answer you are seeking isn't available in:
> <?php phpinfo();?>
> run on the page where you are trying to do this, then you probably
> can't get the answer you want.
>
> Running http://php.net/ldap to re-connect and re-authenticate will
> probably be fairly cheap, since LDAP is supposed to be pretty dang
> fast in the first place, and whatever caching is going on for the LDAP
> or OS calls behind LDAP virtually guarantees that the data you want is
> in RAM.
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some starving artist.
> http://cdbaby.com/browse/from/lynch
> Yeah, I get a buck. So?
>
>
-
Re: [PHP] getting authentication information from apache
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
try echo $PHP_AUTH_USER;
Ryan wrote:
> Richard,
>
> I looked at phpinfo() as you said, same thing...
>
> _SERVER["REMOTE_USER"] no value
>
> You may be right, this may not be available, but I don't want to keep
> throwing a login screen in front of users for no apparent reason.
>
> Thanks,
> Ryan
>
>
>
>
> On 2/23/07, Richard Lynch <ceo@l-i-e.com> wrote:
>> On Wed, February 21, 2007 1:01 pm, Ryan wrote:
>> > I'm new to php and I have am running php on apache. I already have
>> > ldap
>> > authentication set up in apache would rather not create a separate
>> > system
>> > for php. What would be ideal would be to get the current authenticated
>> > user
>> > from the apache environment. At this point I'm grabbing at straws, but
>> > so
>> > far I've tried....
>> >
>> > $ret = apache_getenv("LDAP_USER");
>> > echo $ret;
>> > echo $_SERVER['REMOTE_USER'];
>> > echo $_SERVER['PHP_AUTH_DIGEST'];
>> > $ret = apache_getenv('PHP_AUTH_DIGEST');
>> >
>> > None of these work. Has anyone done this??
>>
>> If the answer you are seeking isn't available in:
>> <?php phpinfo();?>
>> run on the page where you are trying to do this, then you probably
>> can't get the answer you want.
>>
>> Running http://php.net/ldap to re-connect and re-authenticate will
>> probably be fairly cheap, since LDAP is supposed to be pretty dang
>> fast in the first place, and whatever caching is going on for the LDAP
>> or OS calls behind LDAP virtually guarantees that the data you want is
>> in RAM.
>>
>> --
>> Some people have a "gift" link here.
>> Know what I want?
>> I want you to buy a CD from some starving artist.
>> http://cdbaby.com/browse/from/lynch
>> Yeah, I get a buck. So?
>>
>>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFF4AgsGPhC6XW20oARAmruAJ9zpCz5q6mN6rwlRHkyXgtox9ZvWACgnrXa
TFy3y3YOWfFPaFctYAFbDFo=
=6tjM
-----END PGP SIGNATURE-----
-
Re: [PHP] getting authentication information from apache
Tried that ($PHP_AUTH_USER) and it is also empty.
On 2/24/07, dave <dave@proxy.ro> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> try echo $PHP_AUTH_USER;
>
> Ryan wrote:
> > Richard,
> >
> > I looked at phpinfo() as you said, same thing...
> >
> > _SERVER["REMOTE_USER"] no value
> >
> > You may be right, this may not be available, but I don't want to keep
> > throwing a login screen in front of users for no apparent reason.
> >
> > Thanks,
> > Ryan
> >
> >
> >
> >
> > On 2/23/07, Richard Lynch <ceo@l-i-e.com> wrote:
> >> On Wed, February 21, 2007 1:01 pm, Ryan wrote:
> >> > I'm new to php and I have am running php on apache. I already have
> >> > ldap
> >> > authentication set up in apache would rather not create a separate
> >> > system
> >> > for php. What would be ideal would be to get the current authenticated
> >> > user
> >> > from the apache environment. At this point I'm grabbing at straws, but
> >> > so
> >> > far I've tried....
> >> >
> >> > $ret = apache_getenv("LDAP_USER");
> >> > echo $ret;
> >> > echo $_SERVER['REMOTE_USER'];
> >> > echo $_SERVER['PHP_AUTH_DIGEST'];
> >> > $ret = apache_getenv('PHP_AUTH_DIGEST');
> >> >
> >> > None of these work. Has anyone done this??
> >>
> >> If the answer you are seeking isn't available in:
> >> <?php phpinfo();?>
> >> run on the page where you are trying to do this, then you probably
> >> can't get the answer you want.
> >>
> >> Running http://php.net/ldap to re-connect and re-authenticate will
> >> probably be fairly cheap, since LDAP is supposed to be pretty dang
> >> fast in the first place, and whatever caching is going on for the LDAP
> >> or OS calls behind LDAP virtually guarantees that the data you want is
> >> in RAM.
> >>
> >> --
> >> Some people have a "gift" link here.
> >> Know what I want?
> >> I want you to buy a CD from some starving artist.
> >> http://cdbaby.com/browse/from/lynch
> >> Yeah, I get a buck. So?
> >>
> >>
> >
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFF4AgsGPhC6XW20oARAmruAJ9zpCz5q6mN6rwlRHkyXgtox9ZvWACgnrXa
> TFy3y3YOWfFPaFctYAFbDFo=
> =6tjM
> -----END PGP SIGNATURE-----
>
-
Re: [PHP] getting authentication information from apache
Use <?php phpinfo();?> and see what *IS* there.
If what you want isn't there, then the web server didn't provide it.
If the web server didn't provide it, PHP can't be blamed for not
passing it on to you, which is *ALL* PHP does here.
So what you have is a web-server configuration issue in that case.
On Mon, February 26, 2007 11:18 am, Ryan wrote:
> Tried that ($PHP_AUTH_USER) and it is also empty.
>
> On 2/24/07, dave <dave@proxy.ro> wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> try echo $PHP_AUTH_USER;
>>
>> Ryan wrote:
>> > Richard,
>> >
>> > I looked at phpinfo() as you said, same thing...
>> >
>> > _SERVER["REMOTE_USER"] no value
>> >
>> > You may be right, this may not be available, but I don't want to
>> keep
>> > throwing a login screen in front of users for no apparent reason.
>> >
>> > Thanks,
>> > Ryan
>> >
>> >
>> >
>> >
>> > On 2/23/07, Richard Lynch <ceo@l-i-e.com> wrote:
>> >> On Wed, February 21, 2007 1:01 pm, Ryan wrote:
>> >> > I'm new to php and I have am running php on apache. I already
>> have
>> >> > ldap
>> >> > authentication set up in apache would rather not create a
>> separate
>> >> > system
>> >> > for php. What would be ideal would be to get the current
>> authenticated
>> >> > user
>> >> > from the apache environment. At this point I'm grabbing at
>> straws, but
>> >> > so
>> >> > far I've tried....
>> >> >
>> >> > $ret = apache_getenv("LDAP_USER");
>> >> > echo $ret;
>> >> > echo $_SERVER['REMOTE_USER'];
>> >> > echo $_SERVER['PHP_AUTH_DIGEST'];
>> >> > $ret = apache_getenv('PHP_AUTH_DIGEST');
>> >> >
>> >> > None of these work. Has anyone done this??
>> >>
>> >> If the answer you are seeking isn't available in:
>> >> <?php phpinfo();?>
>> >> run on the page where you are trying to do this, then you
>> probably
>> >> can't get the answer you want.
>> >>
>> >> Running http://php.net/ldap to re-connect and re-authenticate
>> will
>> >> probably be fairly cheap, since LDAP is supposed to be pretty
>> dang
>> >> fast in the first place, and whatever caching is going on for the
>> LDAP
>> >> or OS calls behind LDAP virtually guarantees that the data you
>> want is
>> >> in RAM.
>> >>
>> >> --
>> >> Some people have a "gift" link here.
>> >> Know what I want?
>> >> I want you to buy a CD from some starving artist.
>> >> http://cdbaby.com/browse/from/lynch
>> >> Yeah, I get a buck. So?
>> >>
>> >>
>> >
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.1 (MingW32)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>>
>> iD8DBQFF4AgsGPhC6XW20oARAmruAJ9zpCz5q6mN6rwlRHkyXgtox9ZvWACgnrXa
>> TFy3y3YOWfFPaFctYAFbDFo=
>> =6tjM
>> -----END PGP SIGNATURE-----
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?