lewis / oauth2-server-redis
Redis storage adapter for the League's PHP OAuth 2.0 server.
dev-master / 0.1.x-dev
2014-05-10 04:39 UTC
Requires
- predis/predis: ~0.8
Requires (Dev)
- league/oauth2-server: 4.0.*@dev
- mockery/mockery: ~0.9
- squizlabs/php_codesniffer: ~1.5
This package is auto-updated.
Last update: 2024-10-24 13:20:34 UTC
README
This is a Redis storage adapter for the League's PHP OAuth 2.0 server which is maintained by Alex Bilbie.
Foreword
This adapter is for the fourth version of the OAuth 2.0 server and as such is prone to breakages as the server itself is being developed.
Usage
This storage adapter uses Predis as an interface to Redis. Make sure you have Redis installed on your machine to use this adapter.
To begin you must new up and instance of the Predis client.
$redis = new Predis\Client;
Once you have an instance of League\OAuth2\Server\AuthorizationServer
you can set the different storages.
$server->setClientStorage(new Lewis\OAuth2\Server\Storage\RedisClient($redis)); $server->setSessionStorage(new Lewis\OAuth2\Server\Storage\RedisSession($redis)); $server->setAccessTokenStorage(new Lewis\OAuth2\Server\Storage\RedisAccessToken($redis)); $server->setRefreshTokenStorage(new Lewis\OAuth2\Server\Storage\RedisRefreshTokenStorage($redis)); $server->setAuthCodeStorage(new Lewis\OAuth2\Server\Storage\RedisAuthCode($redis)); $server->setScopeStorage(new Lewis\OAuth2\Server\Storage\RedisScope($redis));
License
This package is licensed under the BSD 2-Clause license.