Changeset cb39a77 for src/webapp/apigility/module/Application
- Timestamp:
- Feb 17, 2019, 4:40:52 PM (8 years ago)
- Branches:
- debian/bullseye, master
- Children:
- 3a89adb
- Parents:
- 74c3571
- Location:
- src/webapp/apigility/module/Application/src
- Files:
-
- 3 added
- 1 edited
-
Authentication/SessionAdapter.php (added)
-
Authorization/AuthorizationListener.php (added)
-
Identity/UserIdentity.php (added)
-
Module.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/webapp/apigility/module/Application/src/Module.php
r74c3571 rcb39a77 3 3 * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 4 4 * @copyright Copyright (c) 2014-2016 Zend Technologies USA Inc. (http://www.zend.com) 5 * 6 * partly copied from https://apigility.org/documentation/auth/user-differentiation 5 7 */ 6 8 7 9 namespace Application; 10 11 use ZF\MvcAuth\Authentication\DefaultAuthenticationListener; 12 use Zend\EventManager\EventInterface; 13 use ZF\MvcAuth\MvcAuthEvent; 8 14 9 15 class Module … … 13 19 return include __DIR__ . '/../config/module.config.php'; 14 20 } 21 22 public function onBootstrap(EventInterface $e) 23 { 24 $app = $e->getApplication(); 25 $container = $app->getServiceManager(); 26 27 // Add Authentication Adapter for session 28 $defaultAuthenticationListener = $container->get(DefaultAuthenticationListener::class); 29 $defaultAuthenticationListener->attach(new Authentication\SessionAdapter()); 30 31 // Add Authorization 32 $eventManager = $app->getEventManager(); 33 $eventManager->attach( 34 MvcAuthEvent::EVENT_AUTHORIZATION, 35 new Authorization\AuthorizationListener(), 36 100 37 ); 38 } 15 39 }
Note:
See TracChangeset
for help on using the changeset viewer.
