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

Unable to set different pattern for the protected area #31

Open
russellseymour opened this issue May 10, 2016 · 1 comment
Open

Unable to set different pattern for the protected area #31

russellseymour opened this issue May 10, 2016 · 1 comment

Comments

@russellseymour
Copy link

russellseymour commented May 10, 2016

Hello,

I am implementing OAuth on an area of my application. I am moving from Form based auth to OAuth.

I have been trying to set the pattern for the login to something other that ^/ but I keep getting an error message when I click on my Google button:

image

The firewall is setup as follows:

    $app['security.firewalls'] = [
      'login' => [
        'pattern' => '^/admin',
        'anonymous' => true,
        'oauth' => [
          'failure_path' => '/login',
          'with_csrf' => true
        ],
        'users' => $app -> share(function() use ($app) {
          return $app['model.account'];
        })
      ]
    ];

If I leave the pattern as `^/' then it works, does this mean that it is only possible to use OAuth across the whole website?

Thanks, Russell

@rpensek
Copy link

rpensek commented Oct 9, 2017

@russellseymour: Be sure to include this in the additional path as they should be secured as well, for example:

'default' => array(
            'pattern' => '^/admin',
            'anonymous' => false,
            'oauth' => array(
                'login_path' => '/admin/auth/{service}',
                'callback_path' => '/admin/auth/{service}/callback',
                'check_path' => '/admin/auth/{service}/check',
                'failure_path' => '/login',
                'with_csrf' => true
            )...

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