What is right for me: htAccess, form submission, HTTP header authentication with PHP?

I create a website with several sections - admin, client, user and anonymous - each user group has less access, and then the following. I am wondering which form of authentication would be best for my use?

I heard that if you just deal with websites, then a web form is for you (because it’s prettier). It is reported that authentication of the HTTP header using PHP is becoming clumsy / sloppy. htAcess is pretty much the core of the various authentication methods I've looked at, but is it too much?

+3
source share
3 answers

Go to the form (a session ).
This is currently the only option.

+1
source

You are confusing things.

Your three options are basically two:

  • Use HTTP Authentication
  • Do Not Use HTTP Authentication

Whether this is an .htaccess file or not. You can perform HTTP authentication using Apache and PHP, and you can perform authentication without HTTP using Apache and PHP (although you usually do authentication without HTTP using PHP and HTTP using Apache).

Apache (, CAS). Apache ( sourceforge...) : FreeTDS, MySQL, Oracle, PostgreSQL, SQLite 2/3 ODBC-.

HTTP-. , , " ?". " ".

PHP, ( -).

+2

-, /. , , . , auth . , ...

HTTP- , . , HTTP Digest; OTH PHP.
, . . XMLHttpRequest HTTP. (401 ), . Javascript , , , /. , .

In addition, if your administration group is a serious business (raw database access tools, etc.), you should use both methods. Add the admin interface separately from the application, apply the login form and the restrictions on .htaccess. Better than sorry.

0
source

Source: https://habr.com/ru/post/1749315/


All Articles