doorkeeper-gem/doorkeeper — pull request #415 by samdengler (2014-06-12 21:39:32+00:00)
Title: Add id_token to AccessToken and TokenResponse

Optionally include OpenID Connect "id_token" in TokenResponse.

I don't much like making Doorkeeper aware of an OpenID Connect extension, but I don't see another way to inject an extra property into the TokenResponse body. I like the use of "on_successful_authorization" in the RequestConcern to abstract the TokenRequest implementation, but the TokenResponse seems coupled to knowledge of AccessToken in the TokenResponse.

I plan to provide an implementation to AccessToken#id_token in the OpenID Connect extension gem I'm working on, but thought this might allow an alternate implementations if needed. I'm open to alternate extensions that allow me to inject additional members into the JSON response to a TokenRequest. This was just the most straightforward way I could see to do it (I am not a Rubyist).