R
R
Roman Gor2014-11-19 09:15:02
symfony
Roman Gor, 2014-11-19 09:15:02

Where should I redirect after logging into the service?

I'm studying this bundle: https://github.com/hwi/HWIOAuthBundle
Everything seems to be fine, until the redirect after login.
According to the documentation in security.yml , you need to write the resource_owners path:
I have this:

secured_area:
            oauth:
                resource_owners:
                    vkontakte:           "/login/check-vkontakte"
                login_path:        /connect/vkontakte
                failure_path:      /login
                default_target_path: /login

routing.yml
hwi_oauth_redirect:
    resource: "@HWIOAuthBundle/Resources/config/routing/redirect.xml"
    prefix:   /connect

hwi_oauth_login:
    resource: "@HWIOAuthBundle/Resources/config/routing/login.xml"
    prefix:   /login

vkontakte_login:
    pattern: /login/check-vkontakte

But, after a redirect to /login/check-vkontakte , 500 is thrown, saying that there is no controller that handles this request.
And here I am completely confused.
Should I create this controller? Where? In your own band? What should he do?
There is no mention of this in the doc.
Actually, binding to this bundle is absolutely optional.
Ultimately I need oAuth on Symfony.
Does anyone know of an easier way?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
G
Gregory, 2014-11-19
@difiso

Yes, you have to create a controller that should do something. What exactly he should do is up to you, find the answer to the question "What to show the user after he logs in?". Profile page, news feed, whatever, really. As you answer this question, you will understand which route to prescribe in the configuration.

N
neolink, 2014-11-19
@neolink

in order of processing, the existence of the route in the application is first checked, and only then it can already be intercepted on the corresponding event, that is, you need to add an empty route:

my_vm_login:
    path: /login/check-vkontakte

and then it is already intercepting the security listener that you configured in security.yml

D
Dmitry Mironov, 2014-11-19
@MironovDV

A person has a similar problem https://github.com/hwi/HWIOAuthBundle/issues/158
May not have come across yet.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question