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

Request matcher #18

Open
cyberwolf opened this issue Jul 15, 2015 · 1 comment
Open

Request matcher #18

cyberwolf opened this issue Jul 15, 2015 · 1 comment

Comments

@cyberwolf
Copy link
Contributor

When using the Silex security service provider, CORS preflight requests get halted by the firewall on secured paths.

It would be handy if this package could offer a RequestMatcher implementation to match these preflight requests and let them pass through the firewall. I could then configure the firewall as follows:

$app['security.firewalls'] = array(
    'authentication' => array(
        'pattern' => '^/auth',
    ),
    'cors-preflight' => array(
        'pattern' => $app['cors_preflight_request_matcher'],
    ),
    'secured' => array(
        'pattern' => '^.*$',
        'uitid' => true,
        'users' => $app['uitid_firewall_user_provider'],
    ),
);

I have some working code already in our project (https://github.com/cultuurnet/silex-uitid-provider/blob/master/src/Security/PreflightRequestMatcher.php), I'd be happy to extract it and contribute it through a pull request, unless you see a better way to accomplish this?

@jdesrosiers
Copy link
Owner

Great idea, @cyberwolf. I haven't worked much with the security provider, so I have to look into it a bit.

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