Skip to content

Commit

Permalink
Merge branch 'release/2.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
michalbundyra committed Feb 10, 2020
2 parents ea79e2c + e3c61db commit df26a31
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 15 deletions.
26 changes: 24 additions & 2 deletions CHANGELOG.md
Expand Up @@ -2,7 +2,7 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 2.0.1 - TBD
## 2.0.1 - 2020-02-10

### Added

Expand All @@ -22,7 +22,7 @@ All notable changes to this project will be documented in this file, in reverse

### Fixed

- Nothing.
- [#12](https://github.com/mezzio/mezzio-authentication-oauth2/pull/12) fixes default paths to keys in configuration (uses `data/oauth` directories).

## 2.0.0 - 2019-12-28

Expand All @@ -46,6 +46,28 @@ All notable changes to this project will be documented in this file, in reverse

- Nothing.

## 1.3.1 - 2020-02-10

### Added

- Nothing.

### Changed

- Nothing.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- [#12](https://github.com/mezzio/mezzio-authentication-oauth2/pull/12) fixes default paths to keys in configuration (uses `data/oauth` directories).

## 1.3.0 - 2019-12-28

### Added
Expand Down
26 changes: 13 additions & 13 deletions config/oauth2.php
Expand Up @@ -11,8 +11,8 @@
*/

$config = [
'private_key' => getcwd() . '/data/private.key',
'public_key' => getcwd() . '/data/public.key',
'private_key' => getcwd() . '/data/oauth/private.key',
'public_key' => getcwd() . '/data/oauth/public.key',
'access_token_expire' => 'P1D', // 1 day in DateInterval format
'refresh_token_expire' => 'P1M', // 1 month in DateInterval format
'auth_code_expire' => 'PT10M', // 10 minutes in DateInterval format
Expand All @@ -24,21 +24,21 @@

// Set value to null to disable a grant
'grants' => [
\League\OAuth2\Server\Grant\ClientCredentialsGrant::class
=> \League\OAuth2\Server\Grant\ClientCredentialsGrant::class,
\League\OAuth2\Server\Grant\PasswordGrant::class
=> \League\OAuth2\Server\Grant\PasswordGrant::class,
\League\OAuth2\Server\Grant\AuthCodeGrant::class
=> \League\OAuth2\Server\Grant\AuthCodeGrant::class,
\League\OAuth2\Server\Grant\ImplicitGrant::class
=> \League\OAuth2\Server\Grant\ImplicitGrant::class,
\League\OAuth2\Server\Grant\RefreshTokenGrant::class
=> \League\OAuth2\Server\Grant\RefreshTokenGrant::class
League\OAuth2\Server\Grant\ClientCredentialsGrant::class
=> League\OAuth2\Server\Grant\ClientCredentialsGrant::class,
League\OAuth2\Server\Grant\PasswordGrant::class
=> League\OAuth2\Server\Grant\PasswordGrant::class,
League\OAuth2\Server\Grant\AuthCodeGrant::class
=> League\OAuth2\Server\Grant\AuthCodeGrant::class,
League\OAuth2\Server\Grant\ImplicitGrant::class
=> League\OAuth2\Server\Grant\ImplicitGrant::class,
League\OAuth2\Server\Grant\RefreshTokenGrant::class
=> League\OAuth2\Server\Grant\RefreshTokenGrant::class
],
];

// Conditionally include the encryption_key config setting, based on presence of file.
$encryptionKeyFile = getcwd() . '/data/encryption.key';
$encryptionKeyFile = getcwd() . '/data/oauth/encryption.key';
if (is_readable($encryptionKeyFile)) {
$config['encryption_key'] = require $encryptionKeyFile;
}
Expand Down

0 comments on commit df26a31

Please sign in to comment.