stickee / zend-expressive-auth

此包已被废弃且不再维护。未建议替代包。

通过 Google 进行身份验证

0.1.1 2017-08-21 15:53 UTC

This package is not auto-updated.

Last update: 2022-08-20 16:47:21 UTC


README

Build Status

用于登录到声明性应用的认证

这需要你将 \Stickee\Auth\ConfigProvider 添加到你的主配置中。

目前,此设计用于保护单个路由。

为此,你只需要将中间件添加到该路由的链中

<?php

use Stickee\Auth\Authentication\Middleware as AuthenticationMiddleware;

$app->post(
    '/',
    [
        AuthenticationMiddleware::class,
        ProtectedAction::class,
    ],
    'protected'
);

但确保不要将其添加到将你重定向出去的路由中!

<?php

use \Stickee\Auth\Oauth\RedirectAction;

$app->get('/login/redirect', RedirectAction::class, 'oauth-redirect');