oauth2-bundle
oauth2-bundle copied to clipboard
Allow for a custom ResponseTypeInterface to be used in AuthorizationServer
Right now it's near impossible without a fork, there should be a configuration parameter (default null) which allows one to specify a class to be used to override the behaviour.
For someone who finds this issue and still needs this functionality, you can get around the limitation by writing a new CompilerPass, getting the AuthorizationServer definition and calling setArgument('$responseType', new Reference(MyResponseType::class))
I was also thinking of that last time.
I'm currently working on the Event system (#251). And I'll have to rewrite the Response, maybe it's the good time to implement that also ?
Do you have any leads so we can make a custom Response based on the configuration ?
-- Edit My bad, didn't understand your request, I've change the response formatting for the exception messages
All this needs is an additional configuration parameter in the bundle itself which allows the following values: null | instanceof ResponseTypeInterface (the last param in AuthorizationServer, I'm not exactly sure which one was it) with the null as the default value. One can then extend the BearerResponseType or implement the ResponseTypeInterface to slightly change the behaviour of the AuthorizationServer.
We needed that to implement a "remember me" feature
Maybe it is best to just take up an example compilerpass inside the documentation of this project, as compilerpasses provide the glue between packages and your own project.