https://github.com/api-skeletons/zf-oauth2-doctrine-identity
Doctrine enabled identity zfcampus/zf-mvc-auth replacement for zf-oauth2-doctrine
https://github.com/api-skeletons/zf-oauth2-doctrine-identity
Last synced: 9 months ago
JSON representation
Doctrine enabled identity zfcampus/zf-mvc-auth replacement for zf-oauth2-doctrine
- Host: GitHub
- URL: https://github.com/api-skeletons/zf-oauth2-doctrine-identity
- Owner: API-Skeletons
- License: mit
- Created: 2016-12-28T00:50:25.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-07-03T01:17:08.000Z (about 8 years ago)
- Last Synced: 2025-08-29T16:07:06.763Z (11 months ago)
- Language: PHP
- Homepage: https://apiskeletons.com
- Size: 35.2 KB
- Stars: 3
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
OAuth2 Doctrine Identity
------------------------
[](https://travis-ci.org/API-Skeletons/zf-oauth2-doctrine-identity)
[](https://gitter.im/api-skeletons/open-source)
[](https://www.patreon.com/apiskeletons)
[](https://packagist.org/packages/api-skeletons/zf-oauth2-doctrine-identity)
Versions
--------
1.x for PHP 5.5 to 7.0. 2.x for PHP 7.1 onward.
About
-----
By default [zfcampus/zf-mvc-auth](https://github.com/zfcampus/zf-mvc-auth) returns an [`ZF\MvcAuth\Identity\AuthenticatedIdentity`](https://github.com/zfcampus/zf-mvc-auth/blob/master/src/Identity/AuthenticatedIdentity.php) when authenticated with a valid access token. This repository replaces that identity with a [`ZF\OAuth2\Doctrine\Identity\AuthenticatedIdentity`](https://github.com/API-Skeletons/zf-oauth2-doctrine-identity/blob/master/src/AuthenticatedIdentity.php).
[`ZF\OAuth2\Doctrine\Identity\AuthenticatedIdentity`](https://github.com/API-Skeletons/zf-oauth2-doctrine-identity/blob/master/src/AuthenticatedIdentity.php) stores the [api-skeletons/zf-oauth2-doctrine](https://github.com/API-Skeletons/zf-oauth2-doctrine) `AccessToken` Doctrine entity. The `AuthentiatedIdentity` has the functions `getUser()`, `getAccessToken()`, `getClient()` which return entities. With these your application can continue to work with ORM through the rest of the request lifecycle.
[api-skeletons/zf-oauth2-doctrine](https://github.com/API-Skeletons/zf-oauth2-doctrine) supports multiple OAuth2 configurations and [api-skeletons/zf-oauth2-doctrine-identity](https://github.com/API-Skeletons/zf-oauth2-doctrine-identity) searches through each configuration to find the `AccessToken` entity based on the `access_token` and `client_id` supplied by [`ZF\MvcAuth\Identity\AuthenticatedIdentity`](https://github.com/zfcampus/zf-mvc-auth/blob/master/src/Identity/AuthenticatedIdentity.php).
Authorization
-------------
The zf-mvc-auth Authorization Service is injected into the `AuthenticatedIdentity`. You may fetch the Authorization Service with `$identity->getAuthorizationService()`. There is a convenience method for ACL `$identity->isAuthorized($resource, $privilege)`.
Installation
------------
Installation of this module uses composer. For composer documentation, please refer to [getcomposer.org](http://getcomposer.org/).
```sh
composer require api-skeletons/zf-oauth2-doctrine-identity
```
This will be added to your application's list of modules:
```php
'modules' => array(
...
'ZF\OAuth2\Doctrine\Identity',
),
```