Updated examples

This commit is contained in:
Alex Bilbie 2017-07-02 18:52:06 +01:00
parent bffee04b44
commit cbb56e041a
5 changed files with 10 additions and 10 deletions

View File

@ -62,7 +62,7 @@ $refreshTokenRepository = new RefreshTokenRepository(); // instance of RefreshTo
$privateKey = 'file://path/to/private.key';
//$privateKey = new CryptKey('file://path/to/private.key', 'passphrase'); // if private key has a pass phrase
$publicKey = 'file://path/to/public.key';
$encryptionKey = 'lxZFUEsBCJ2Yb14IF2ygAHI5N4+ZAUXXaSeeJm6+twsUmIen'; // generate using base64_encode(random_bytes(32))
// Setup the authorization server
$server = new \League\OAuth2\Server\AuthorizationServer(
@ -70,7 +70,7 @@ $server = new \League\OAuth2\Server\AuthorizationServer(
$accessTokenRepository,
$scopeRepository,
$privateKey,
$publicKey
$encryptionKey
);
$grant = new \League\OAuth2\Server\Grant\AuthCodeGrant(

View File

@ -36,7 +36,7 @@ $accessTokenRepository = new AccessTokenRepository(); // instance of AccessToken
// Path to public and private keys
$privateKey = 'file://path/to/private.key';
//$privateKey = new CryptKey('file://path/to/private.key', 'passphrase'); // if private key has a pass phrase
$publicKey = 'file://path/to/public.key';
$encryptionKey = 'lxZFUEsBCJ2Yb14IF2ygAHI5N4+ZAUXXaSeeJm6+twsUmIen'; // generate using base64_encode(random_bytes(32))
// Setup the authorization server
$server = new \League\OAuth2\Server\AuthorizationServer(
@ -44,7 +44,7 @@ $server = new \League\OAuth2\Server\AuthorizationServer(
$accessTokenRepository,
$scopeRepository,
$privateKey,
$publicKey
$encryptionKey
);
// Enable the client credentials grant on the server

View File

@ -48,7 +48,7 @@ $authCodeRepository = new AuthCodeRepository(); // instance of AuthCodeRepositor
$privateKey = 'file://path/to/private.key';
//$privateKey = new CryptKey('file://path/to/private.key', 'passphrase'); // if private key has a pass phrase
$publicKey = 'file://path/to/public.key';
$encryptionKey = 'lxZFUEsBCJ2Yb14IF2ygAHI5N4+ZAUXXaSeeJm6+twsUmIen'; // generate using base64_encode(random_bytes(32))
// Setup the authorization server
$server = new \League\OAuth2\Server\AuthorizationServer(
@ -56,7 +56,7 @@ $server = new \League\OAuth2\Server\AuthorizationServer(
$accessTokenRepository,
$scopeRepository,
$privateKey,
$publicKey
$encryptionKey
);
// Enable the implicit grant on the server

View File

@ -43,7 +43,7 @@ $refreshTokenRepository = new RefreshTokenRepository(); // instance of RefreshTo
// Path to public and private keys
$privateKey = 'file://path/to/private.key';
//$privateKey = new CryptKey('file://path/to/private.key', 'passphrase'); // if private key has a pass phrase
$publicKey = 'file://path/to/public.key';
$encryptionKey = 'lxZFUEsBCJ2Yb14IF2ygAHI5N4+ZAUXXaSeeJm6+twsUmIen'; // generate using base64_encode(random_bytes(32))
// Setup the authorization server
$server = new \League\OAuth2\Server\AuthorizationServer(
@ -51,7 +51,7 @@ $server = new \League\OAuth2\Server\AuthorizationServer(
$accessTokenRepository,
$scopeRepository,
$privateKey,
$publicKey
$encryptionKey
);
$grant = new \League\OAuth2\Server\Grant\PasswordGrant(

View File

@ -39,7 +39,7 @@ $refreshTokenRepository = new RefreshTokenRepository();
// Path to public and private keys
$privateKey = 'file://path/to/private.key';
//$privateKey = new CryptKey('file://path/to/private.key', 'passphrase'); // if private key has a pass phrase
$publicKey = 'file://path/to/public.key';
$encryptionKey = 'lxZFUEsBCJ2Yb14IF2ygAHI5N4+ZAUXXaSeeJm6+twsUmIen'; // generate using base64_encode(random_bytes(32))
// Setup the authorization server
$server = new \League\OAuth2\Server\AuthorizationServer(
@ -47,7 +47,7 @@ $server = new \League\OAuth2\Server\AuthorizationServer(
$accessTokenRepository,
$scopeRepository,
$privateKey,
$publicKey
$encryptionKey
);
$grant = new \League\OAuth2\Server\Grant\RefreshTokenGrant($refreshTokenRepository);