Installation is simple:
composer require "saeven/zf3-circlical-user"
This will install the library and all required parts.
You'll need to roll three providers of your own:
- A Role provider that implements RoleProviderInterface. See RoleMapper for a sample implementation.
- A Group Permission provider that implements GroupPermissionProviderInterface. See GroupPermissionMapper for a sample implementation.
- A User Permission provider that implements UserPermissionProviderInterface. See UserPermissionMapper for a sample implementation.
These will get plugged into the library using existing factories. Don't forget to create factories of your own, as required.
- Copy
/vendor/saeven/zf3-circlical-user/config/circlical.user/local.php.dist
into your global autoload folder, remove the dist extension so that Zend Framework picks it up - Substitute the 'providers/user' config key, with your own User entity
- Make your User entity implement UserInterface
- Change 'providers/role' to be the class name of your Role provider
- Change 'providers/rules/group' and 'providers/rules/user' to the class names of your Group and User Permission providers, respectively.
- Add CirclicalUser to your
application.config.php
(effectively, loading the module)
The library is now connected, and should work.
For production use, you should change the crypto_key configuration element to be unique. This is generated using Halite. Like so:
KeyFactory::generateEncryptionKey()->getRawKeyMaterial()
The crypto_key, is a base64 of this value.
base64_encode( KeyFactory::generateEncryptionKey()->getRawKeyMaterial() );
TODO: Provide a CLI command to generate custom keys