concept authentication in category php

appears as: uthentication, Authentication, authentication
Zend Framework in Action

This is an excerpt from Manning's book Zend Framework in Action.

Not every application needs to identify its users, but it is a surprisingly common requirement. Authentication is the process of identifying a user, usually via a token, such as a username/password pair, but it could equally be via a fingerprint. Access control is the process of deciding whether the authenticated user is allowed to have access to, and operate on, a given resource, such as a database record.

As there are two separate processes, Zend Framework provides two separate components: Zend_Acl and Zend_Auth. Zend_Auth is used to identify the user and is typically used in conjunction with Zend_Session, which can store that information across multiple page requests (known as token persistence). Zend_Acl then uses the authentication token to provide access to private information using a role-based access control (RBACL) system.

7.1. Introducing Authentication and Access Control

There are two different processes involved when it comes to allowing a user access to specific pages on a website. Authentication is the process of identifying an individual based on her credentials (usually username and password), and access control is the process of deciding whether the user is allowed to do something. Zend Framework’s Zend_Auth and Zend_Acl components provide comprehensive support for all aspects of authentication and access control for websites.

Because you must know who the user is before you decide if he or she can do something, it follows that the authentication process must occur before access control, so we’ll look at authentication and Zend_Auth first, before looking at Zend_Acl.

PHP in Action: Objects, Design, Agility

This is an excerpt from Manning's book PHP in Action: Objects, Design, Agility.

How can we make it clearer which parts of this example do what? The outer conditionals are involved in login and authentication. The part that properly belongs to this particular web page is all inside the conditional branch following if ($current_user). So a way to separate the page-specific code from login and authentication is to extract everything inside this branch into a separate function. Or we could place it in a file and include it. The problem with using include for the application content is that it’s exactly the wrong way around. The URL would belong to the login page, and since login will be used for most or all pages, all pages get the same URL. It is possible, and common, to do it that way, and we will get to that later. But we don’t want that to be our only option. So for now it’s better to have URL belong to the news form page, and let that page include the login and authentication code.

To do that, it will be helpful to make the login and authentication code more manageable. In listing 11.7, the conditional statements related to login and authentication have been isolated so they’re easier to see.