oauth2-server: BC break when extending BearerTokenResponse

My application just broke down when upgrading to 7.3.0, working fine still when downgrading to 7.2.0.

I’m using the following override in my custom OAuth2Server class to customize the response type:

    /**
     * {@inheritdoc}
     */
    protected function getResponseType()
    {
        $this->responseType = new ExtendedBearerTokenResponse(...someparameters);

        return parent::getResponseType();
    }

The extended response class overrides the default BearerTokenResponse in getExtraParams to add some extra properties to the token. This method is apparently not called anymore, or ignored, as the tokens no longer contain the extra properties.

Have an appointment in 5 minutes so no time to debug further right now, but posting this already hoping you may have an idea what’s causing this and issue a fix before I can investigate deeper tomorrow.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 22 (14 by maintainers)

Most upvoted comments

Yep, I can confirm 7.3.2 is working fine again, cheers!

Sorry that I haven’t resolved this yet. I’ve been pretty busy in work. I suspect we will have to implement @ceeram’s PR in the meantime and accept that the stateless implementations will have their keys reset unnecessarily.

I will take a closer look at this this evening and aim to get a resolution in place. Long term, I think is is preferable to set the custom response via the constructor so will look at options in version 8 to formalise this as it will require a breaking change.