I need to come up with a way to allow only myself (and possibly a few others) to authenticate with my site. However, ideally I’d like for this not to be a public function. I could obscure a login function somehow, but I’m wondering if there’s a better way to do this…
Suggestions?
The go-to way for simple authentication with Apache is to use an .htaccess file for setting up simple authentication. The browser will prompt visitors for a username and password, and deny anyone without the right credentials. The password text is send encoded (base 64, if memory serves), so you’ll want https if you’re trying to keep out people who know how to sniff http traffic.
That said, most websites these days are managed with a CMS of some kind (Drupal), and most CMS’s come prebuilt with ways to have users authenticate against different parts of the site. Unless you’re interested in the exercise of doing this on your own, I’d just let the CMS handle it.