Abstract
Authenticating user identities is common practice not only for security-related reasons, but also to offer customizable features based on user preferences and type. Typically, users are prompted for a username and password, the combination of which forms a unique identifying value for that user. In this chapter, you’ll learn how to prompt for and validate this information using a variety of methods, including a simple approach involving Apache’s htpasswd feature and approaches involving comparing the provided username and password to values stored directly within the script, within a file, and within a database. In addition, you’ll learn how to use the Auth_HTTP PEAR package, test password strength using the CrackLib extension, and recover lost passwords using a concept known as a one-time URL. In summary, the chapter concepts include:
-
Basic HTTP-based authentication concepts
-
PHP’s authentication variables, namely $_SERVER[‘PHP_AUTH_USER’] and $_SERVER[‘PHP_AUTH_PW’]
-
Several PHP functions that are commonly used to implement authentication procedures
-
Three commonplace authentication methodologies: hard-coding the login pair (username and password) directly into the script, file-based authentication, and database-based authentication
-
Taking advantage of the Auth_HTTP package
-
Testing password guessability using the CrackLib extension
-
Recovering lost passwords using one-time URLs
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
Rights and permissions
Copyright information
© 2010 W. Jason Gilmore
About this chapter
Cite this chapter
(2010). Authenticating Your Users. In: Beginning PHP and MySQL. Apress. https://doi.org/10.1007/978-1-4302-3115-8_14
Download citation
DOI: https://doi.org/10.1007/978-1-4302-3115-8_14
Publisher Name: Apress
Print ISBN: 978-1-4302-3114-1
Online ISBN: 978-1-4302-3115-8
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books