mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-22 21:19:46 +05:30
Updated examples
This commit is contained in:
parent
bffee04b44
commit
cbb56e041a
@ -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(
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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(
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user