oauth2-bundle icon indicating copy to clipboard operation
oauth2-bundle copied to clipboard

Allow for a custom ResponseTypeInterface to be used in AuthorizationServer

Open pkly opened this issue 4 years ago • 4 comments

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.

pkly avatar Nov 27 '20 13:11 pkly

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))

pkly avatar Nov 30 '20 09:11 pkly

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

froozeify avatar Dec 06 '20 16:12 froozeify

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

pkly avatar Dec 07 '20 09:12 pkly

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.

TomvEtten avatar Jun 22 '21 11:06 TomvEtten