silex-oauth icon indicating copy to clipboard operation
silex-oauth copied to clipboard

Injecting parameters into OAuth services

Open oniric85 opened this issue 8 years ago • 0 comments

Hi, I'm trying to inject some parameters through setters into the OAuth services. The base library you are using has some services which have setter methods to configure specific options. For example:

https://github.com/Lusitanian/PHPoAuthLib/blob/29bda6e176df6c292a9b1c43ae8a44d56a87c30b/src/OAuth/OAuth2/Service/Strava.php#L131

I've built a custom OAuth service and now I would like to do a similar thing using silex-oauth but I can't access services directly because they are stored in the ServiceRegistry and if I try to get a service from there with a getService call I get an exception:

RouteNotFoundException in UrlGenerator.php line 134: Unable to generate a URL for the named route "_auth_service_callback" as such route does not exist.

I guess that's because the route is created when the OAuthAuthenticationListener is created too while I'm trying to access the OAuth Service from another ServiceProvider I'm writing.

Is there a way provided by the library to achieve what I'm trying?

oniric85 avatar Jul 20 '16 17:07 oniric85