PHPackages                             denits/yii-apiauth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. denits/yii-apiauth

ActiveLibary[Authentication &amp; Authorization](/categories/authentication)

denits/yii-apiauth
==================

HTTP authentication for automated requests

v1.0.1-beta(11y ago)119New BSD LicensePHP &gt;=5.3.16

Since May 2Compare

[ Source](https://github.com/DenitS/yii-apiAuth)[ Packagist](https://packagist.org/packages/denits/yii-apiauth)[ Docs](http://github.com/DenitS/yii-apiAuth)[ RSS](/packages/denits-yii-apiauth/feed)WikiDiscussions Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

Yii ApiAuth Extension
=====================

[](#yii-apiauth-extension)

ApiAuth : The first A in AAA

Authenticate a (REST) client through Http Authentication Methods like Http Digest or Http Basic (or implement your own authentication scheme)

Most webservers, like Apache or IIS support different types of HTTP authentication, but they can be difficult (if not impossible) to integrate with a custom user account source, especially one that is implemented in Yii. This extension uses only Yii, PHP and MySQL and should be easy to integrate in an existing Yii based Authorization scenario.

Even though this extension can be used for virtually any authentication scenario, it is mostly suitable for automation, for example in REST requests. Hence it's name apiAuth.

Yii comes with an extensive built in authorization scheme and many great extensions like Rights, Auth or yii-user that you can use alongside this extension. @see

Home
----

[](#home)

```
https://github.com/DenitS/yii-apiAuth/

```

Git Clone
---------

[](#git-clone)

```
git clone git@github.com:DenitS/yii-apiAuth.git

```

Requirements
------------

[](#requirements)

- Yii 1.1.12 or newer
- PHP 5.3 or newer
- A database system like MySQL (Other database systems than MySQL are currently not supported, but probably easy to implement).

Installation
------------

[](#installation)

1. Add apiAuth to the extensions folder:

    1. Manual:

        1. Create a folder 'apiAuth' in the extensions folder (application.extensions)
        2. Copy the contents of the yii-apiAuth extension to it.
    2. Git Submodule (from command line in \[webroot\]/protected/extensions/):

        1. $ `git submodule add git@github.com:DenitS/yii-apiAuth.git apiAuth`
2. Create the nonce table by running (command line in protected folder):

    $ `./yiic migrate up --migrationPath=ext.apiAuth.migrations`

Configuration
-------------

[](#configuration)

main.php

```

```

Securing Controllers
--------------------

[](#securing-controllers)

Secure controllers and actions by extending your controller with AController (Note the A).

Example:

```
