Skip to content
This repository has been archived by the owner on Mar 9, 2020. It is now read-only.

Commit

Permalink
Merge pull request #22 from basz/feature/miscs
Browse files Browse the repository at this point in the history
readme / mutatetablenames suggest
  • Loading branch information
TomHAnderson committed May 12, 2015
2 parents e3ad481 + 4e80285 commit 0fa14ca
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This repository supplies every entity you need to implement OAuth2 except the Us

The User entity must implement `ZF\OAuth2\Doctrine\Entity\UserInterface`

The User entitiy for the unit test for this module is a good template to start from: [https://github.com/TomHAnderson/zf-oauth2-doctrine/blob/master/test/asset/module/Doctrine/src/Entity/User.php](https://github.com/TomHAnderson/zf-oauth2-doctrine/blob/master/test/asset/module/Doctrine/src/Entity/User.php)
The User entity for the unit test for this module is a good template to start from: [https://github.com/TomHAnderson/zf-oauth2-doctrine/blob/master/test/asset/module/Doctrine/src/Entity/User.php](https://github.com/TomHAnderson/zf-oauth2-doctrine/blob/master/test/asset/module/Doctrine/src/Entity/User.php)


Using Default Entities
Expand All @@ -55,7 +55,7 @@ Details for creating your database with the included entities are outside the sc

By default this module uses the entities provided but you may toggle this and use your own entites (and map them in the mapping config section) by toggling this flag:

```
```php
'zf-oauth2-doctrine' => array(
'storage_settings' => array(
'enable_default_entities' => true,
Expand Down Expand Up @@ -83,3 +83,16 @@ If you need to customize the call to mapManyToOne, which creates the dynamic joi

```

Identity field on User entity
-----------------------------

By default the DoctrineAdapter for OAuth2 retrieves the user by 'username' field on the entity. If you need to use a different or multiple fields you can do that via the 'auth_identity_fields' key. For example; ZfcUser allows users to authenticate by username and/or email fields.

example : match ZfcUser `auth_identity_fields` configuration

```php
'zf-oauth2-doctrine' => array(
'storage_settings' => array(
'auth_identity_fields' => array('username', 'email'), // defaults to array('username')
```

3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@
"classmap": [
"Module.php"
]
},
"suggest": {
"bushbaby/zf-oauth2-doctrine-mutatetablenames": "Allows configuration of the table names that this module uses"
}
}

0 comments on commit 0fa14ca

Please sign in to comment.