laborci/mik-auth

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (dev-master) of this package.

dev-master 2018-11-16 09:10 UTC

This package is auto-updated.

Last update: 2020-08-19 16:39:39 UTC


README

Phlex module for handling MIK-AUTH

copy the config file into your configs, fill it, and add a reference to index.php

putenv('PXCONFIG=config.php,config.auth.php');

do not forget to add MikAuth to the service manager

ServiceManager::bind('AuthRedirectClass')->value(\MikAuth\Action\AuthRedirect::class);
ServiceManager::bind(MikAuthServiceInterface::class)->sharedService(MikAuthService::class);
ServiceManager::bind(MikUserApiServiceInterface::class)->sharedService(MikUserApiService::class);
ServiceManager::bind(MikUserContainerInterface::class)->sharedService(MikUserContainer::class);

finally add auth to your router

$router->get('/auth/login', AuthRedirect::class, ['method' => 'login']);
$router->get('/auth/success/{token}', AuthRedirect::class, ['method' => 'success']);
$router->addMiddleware(AuthCheck::class);
$router->get('/auth/logout', AuthRedirect::class, ['method' => 'logout']);
$router->get('/', Page\Index::class);