You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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.
I think I have the same problem when trying to use oauth2-openid-server (steverhoades/oauth2-openid-connect-server#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
Activity
simonhamp commentedon May 18, 2018
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.
christiaangoossens commentedon Jul 13, 2018
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.
Richard87 commentedon Sep 24, 2018
Hi!
I think I have the same problem when trying to use oauth2-openid-server (steverhoades/oauth2-openid-connect-server#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....
Sephster commentedon Dec 13, 2018
Hey @gingabeard and @Richard87. The way you would normally do this is as follows:
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