S
S
svd712015-09-05 13:49:03
PHP
svd71, 2015-09-05 13:49:03

How to configure Apache2 to authorize from a request?

On the home server, you need to make authorization directly from the request. The request looks like this:

https : //[email protected]/index.php/

When trying to send a request to the site, the browser wonders twice if the user is an idiot, displaying a confirmation window:
You are about to log in to the site "192.168.1.2" with the username "userabrakadabra", but the website does not require authentication. This may be an attempt to trick you.
Is "192.168.1.2" the site you want to visit?

When viewing all variables in php, no data about the passed user was found. That is, the browser stupidly threw out an important part of the request at its own discretion. This means that there must be something confirming from the server that auto-authentication is possible. Who knows what specifically needs to be added to the Apache settings, php or script?
Upd: I won the first part of the question - I added a line to htaccess
AuthType Digest
. And the browser stopped being interested in my adequacy. But after displaying the page of the transferred user, I can’t find it anywhere in any variables.
PS: Don't be fooled by the fact that it's not safe and so on - a home server.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Skobkin, 2015-09-07
@skobkin

First, although it's a bit irrelevant to the question, I would recommend dropping Apache in favor of Nginx + PHP-FPM. Well, this is if you want a more optimal server.
Second, what you want is HTTP Authentication . It is you who will configure authentication using Apache tools (do not confuse authorization with it).
If you need to do it in a script, then check out the official documentation .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question