Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing of additional authorization uri parameters #29

Open
oniric85 opened this issue Feb 1, 2016 · 2 comments
Open

Allow passing of additional authorization uri parameters #29

oniric85 opened this issue Feb 1, 2016 · 2 comments

Comments

@oniric85
Copy link

oniric85 commented Feb 1, 2016

I see that authorization uri is built here https://github.com/gigablah/silex-oauth/blob/master/src/Security/Firewall/OAuthAuthenticationListener.php#L135

The method getAuthorizationUri accepts an array of parameters so it would be cool if we could use that to pass additional information during the uri build process. I'm asking this because I would like to dinamically configure an authorization url parameter and, untill now, I've failed to find an alternative solution.

@gigablah
Copy link
Owner

gigablah commented Feb 1, 2016

I could have the dispatcher fire an event with the authorization params array, so you could modify it with an event listener. Would that solve your issue?

if (null !== $this->dispatcher) {
    $authEvent = new FilterAuthEvent($authorizationParameters);
    $this->dispatcher->dispatch(OAuthEvents::AUTH, $authEvent);
    $authorizationParameters = $authEvent->getAuthorizationParameters();
}

@oniric85
Copy link
Author

oniric85 commented Feb 1, 2016

Thanks for your reply, I thought about such an approach. It seems quite reasonable, only other option I thought about is to allow passing query string parameters to service login_url which are then passed to the authorization url before the redirect. Not sure if this is as clean as the dispatcher approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants