Skip to content

Commit

Permalink
Fixed examples
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbilbie committed Jul 1, 2017
1 parent 0a6a4de commit 2824f7d
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 16 deletions.
4 changes: 1 addition & 3 deletions examples/public/auth_code.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,15 @@
$refreshTokenRepository = new RefreshTokenRepository();

$privateKeyPath = 'file://' . __DIR__ . '/../private.key';
$publicKeyPath = 'file://' . __DIR__ . '/../public.key';

// Setup the authorization server
$server = new AuthorizationServer(
$clientRepository,
$accessTokenRepository,
$scopeRepository,
$privateKeyPath,
$publicKeyPath
'lxZFUEsBCJ2Yb14IF2ygAHI5N4+ZAUXXaSeeJm6+twsUmIen'
);
$server->setEncryptionKey('lxZFUEsBCJ2Yb14IF2ygAHI5N4+ZAUXXaSeeJm6+twsUmIen');

// Enable the authentication code grant on the server with a token TTL of 1 hour
$server->enableGrantType(
Expand Down
4 changes: 1 addition & 3 deletions examples/public/client_credentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,15 @@
// Path to public and private keys
$privateKey = 'file://' . __DIR__ . '/../private.key';
//$privateKey = new CryptKey('file://path/to/private.key', 'passphrase'); // if private key has a pass phrase
$publicKey = 'file://' . __DIR__ . '/../public.key';

// Setup the authorization server
$server = new AuthorizationServer(
$clientRepository,
$accessTokenRepository,
$scopeRepository,
$privateKey,
$publicKey
'lxZFUEsBCJ2Yb14IF2ygAHI5N4+ZAUXXaSeeJm6+twsUmIen'
);
$server->setEncryptionKey('lxZFUEsBCJ2Yb14IF2ygAHI5N4+ZAUXXaSeeJm6+twsUmIen');

// Enable the client credentials grant on the server
$server->enableGrantType(
Expand Down
3 changes: 1 addition & 2 deletions examples/public/implicit.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,14 @@
$accessTokenRepository = new AccessTokenRepository();

$privateKeyPath = 'file://' . __DIR__ . '/../private.key';
$publicKeyPath = 'file://' . __DIR__ . '/../public.key';

// Setup the authorization server
$server = new AuthorizationServer(
$clientRepository,
$accessTokenRepository,
$scopeRepository,
$privateKeyPath,
$publicKeyPath
'lxZFUEsBCJ2Yb14IF2ygAHI5N4+ZAUXXaSeeJm6+twsUmIen'
);
$server->setEncryptionKey('lxZFUEsBCJ2Yb14IF2ygAHI5N4+ZAUXXaSeeJm6+twsUmIen');

Expand Down
4 changes: 1 addition & 3 deletions examples/public/middleware_use.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,15 @@
$refreshTokenRepository = new RefreshTokenRepository();

$privateKeyPath = 'file://' . __DIR__ . '/../private.key';
$publicKeyPath = 'file://' . __DIR__ . '/../public.key';

// Setup the authorization server
$server = new AuthorizationServer(
$clientRepository,
$accessTokenRepository,
$scopeRepository,
$privateKeyPath,
$publicKeyPath
'lxZFUEsBCJ2Yb14IF2ygAHI5N4+ZAUXXaSeeJm6+twsUmIen'
);
$server->setEncryptionKey('lxZFUEsBCJ2Yb14IF2ygAHI5N4+ZAUXXaSeeJm6+twsUmIen');

// Enable the authentication code grant on the server with a token TTL of 1 hour
$server->enableGrantType(
Expand Down
3 changes: 1 addition & 2 deletions examples/public/password.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
new AccessTokenRepository(), // instance of AccessTokenRepositoryInterface
new ScopeRepository(), // instance of ScopeRepositoryInterface
'file://' . __DIR__ . '/../private.key', // path to private key
'file://' . __DIR__ . '/../public.key' // path to public key
'lxZFUEsBCJ2Yb14IF2ygAHI5N4+ZAUXXaSeeJm6+twsUmIen' // encryption key
);
$server->setEncryptionKey('lxZFUEsBCJ2Yb14IF2ygAHI5N4+ZAUXXaSeeJm6+twsUmIen');

$grant = new PasswordGrant(
new UserRepository(), // instance of UserRepositoryInterface
Expand Down
4 changes: 1 addition & 3 deletions examples/public/refresh_token.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,15 @@
$refreshTokenRepository = new RefreshTokenRepository();

$privateKeyPath = 'file://' . __DIR__ . '/../private.key';
$publicKeyPath = 'file://' . __DIR__ . '/../public.key';

// Setup the authorization server
$server = new AuthorizationServer(
$clientRepository,
$accessTokenRepository,
$scopeRepository,
$privateKeyPath,
$publicKeyPath
'lxZFUEsBCJ2Yb14IF2ygAHI5N4+ZAUXXaSeeJm6+twsUmIen'
);
$server->setEncryptionKey('lxZFUEsBCJ2Yb14IF2ygAHI5N4+ZAUXXaSeeJm6+twsUmIen');

// Enable the refresh token grant on the server
$grant = new RefreshTokenGrant($refreshTokenRepository);
Expand Down

0 comments on commit 2824f7d

Please sign in to comment.