Hey guys
I wanted to put a user_id in the token response, and line 66 of BearerTokenResponse says:
/**
* Add custom fields to your Bearer Token response here, then override
* AuthorizationServer::getResponseType() to pull in your version of
* this class rather than the default.
This doesn't work though, as AuthorizationServer->encryptionKey, which is used in
AuthorizationServer::getResponseType() is declared private.
Any chance it could be updated to _protected_ to enable this modification please?
Cheers
Alex
Hi Alex, please feel free to make a PR for this 馃檪
Note that there are a number of related issues currently open and some PRs too.
So it may be that this change makes its way into a bigger release.
While looking at making a PR for making the addition of information to JWT's easier, I found the solution to this problem as well. Line 66 seems to be a documentation error, you should pass in the responseType (linking to your implementation of BearerTokenResponse) as the last parameter when creating the AuthorizationServer, instead of overwriting elements of that class. The documentation block should be changed to reflect that.
Hi!
I think I have the same problem when trying to use oauth2-openid-server (https://github.com/steverhoades/oauth2-openid-connect-server/issues/21), the Implicit Grant completley disregards the responseType, so I don't know how to add the id_token response required in OpenID except creating a new OidcImplicitGrant, wich feels wrong....
Hey @gingabeard and @Richard87. The way you would normally do this is as follows:
class MyAuthorizationServer extends AuthorizationServer
{
protected function getResponseType()
{
$this->responseType = new MyCustomResponseType();
return parent::getResponseType();
}
If you implement your custom response like this. It should resolve your issue. I will mark this as resolved but if this doesn't solve your issue, please feel free to get back and I will reopen this issue. Thanks
Most helpful comment
While looking at making a PR for making the addition of information to JWT's easier, I found the solution to this problem as well. Line 66 seems to be a documentation error, you should pass in the responseType (linking to your implementation of BearerTokenResponse) as the last parameter when creating the AuthorizationServer, instead of overwriting elements of that class. The documentation block should be changed to reflect that.