FriendsOfSymfony / FOSOAuthServerBundle

A server side OAuth2 Bundle for Symfony
1.09k stars 451 forks source link

How to setup authentication for auth path #495

Open phtmgt opened 6 years ago

phtmgt commented 6 years ago

Ok, so I googled and tried to figure out how to 'Add your favorite authentication process here' with no success. Whenever I try to add some form_login there, it tells me the patterns don't match.

oauth_authorize:
            pattern:    ^/oauth/v2/auth
            # Add your favorite authentication process here
...

Ideally I want to use google login through HWIOauthBundle there. My current configuration uses the regular login form from my main firewall and this is not ideal.

Any suggestions appreciated.

Thanks.

dinamic commented 6 years ago

I was able to use form_login like so:

        oauth_authorize:
            pattern:    ^/oauth/v2/auth
            form_login:
                provider: fos_userbundle
                check_path: /oauth/v2/auth_login
                login_path: /oauth/v2/auth_login

Would this work for you?