Skip to content

v0.7.0

Compare
Choose a tag to compare
@bakura10 bakura10 released this 01 Aug 08:08
· 317 commits to master since this release
0.7.0
  • [BC] PHP minimum version has been bumped to 5.5. As a consequence, Zend\Crypt dependency has been removed as some of features are built-in into PHP 5.5.
  • [BC] Instead of Zend\Http requests and responses, the module now uses PSR7 requests and responses, for increased compatibility. If you are using the ZF2 module, this should be completely transparent to you.
  • [BC] Contrary to Zend\Http requests and responses, PSR7 are stateless. If you are using events to modify the response, you will need to use a different way.

In ZfrOAuth2Server 0.6:

public function tokenCreated(TokenEvent $event)
    {
        // We can log the access token
        $accessToken = $event->getAccessToken();
        // ...

        // Or we can alter the response body, if we need to
        $body                 = $event->getResponseBody();
        $body['custom_field'] = 'bar';

        // Update the body
        $event->setResponseBody($body);
    }

In ZfrOAuth2Server 0.7+:

public function tokenCreated(TokenEvent $event)
    {
        // Get the response
        $response = $event->getResponse();
        // ...

        // Response is a PSR-7 compliant response, so you modify it
        $response = $response->withHeader(...);

        // Do not forget to set back the response, as PSR-7 are immutable
        $event->setResponse($response);
    }
  • Interfaces for ResourceServer and AuthorizationServer has been added, for easier testing.