circli / api-auth-extension
Installs: 1 923
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:circli-extension
Requires
- circli/auth-extension: ^1.0
- circli/core: ^1.0
- php-di/php-di: ^6.0
- psr/container: ^1.0
- psr/http-message: ^1.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- phpunit/phpunit: ~8.0
- roave/security-advisories: dev-master
This package is auto-updated.
Last update: 2024-11-29 09:42:18 UTC
README
Extension to help with basic api authentication
The package include 3 different authentication providers
BasicAuth
Usage
use Circli\ApiAuth\Repository\ArrayBasicAuthRepository; use Circli\ApiAuth\Provider\BasicAuthProvider; use Circli\ApiAuth\Middleware\ApiAuthenticationMiddleware; $authRepository = new ArrayBasicAuthRepository(['admin' => 'password']); $middleware = new ApiAuthenticationMiddleware(new BasicAuthProvider($authRepository));
AccessKey
Usage
use Circli\ApiAuth\Repository\AccessKeyRepository; use Circli\ApiAuth\Provider\AccessKeyProvider; use Circli\ApiAuth\Middleware\ApiAuthenticationMiddleware; $repository = new YourImplementationOfAccessKeyRepository(); $middleware = new ApiAuthenticationMiddleware(new AccessKeyProvider($repository));
Token
Usage
use Circli\ApiAuth\Repository\AuthTokenRepository; use Circli\ApiAuth\Provider\AuthTokenProvider; use Circli\ApiAuth\Middleware\ApiAuthenticationMiddleware; $repository = new YourImplementationOfAuthTokenRepository(); $middleware = new ApiAuthenticationMiddleware(new AuthTokenProvider($repository));