I
I
Igor Surname2019-09-11 15:11:31
symfony
Igor Surname, 2019-09-11 15:11:31

How to set up a login to the site through the contact HWIOAuthBundle + Symfony4.3?

I make a login on the site through Google, Facebook and Contact. There are no problems with the first two, but I can’t set up a contact in any way. I created an application in contact, I specified the ID and secure_key in my project.
Translates to the page https://oauth.vk.com/authorize and shows an error:

{"error":"invalid_request","error_description":"invalid scope"}

hwi_oauth.yaml:
resource_owners:
        vkontakte:
            type:                vkontakte
            client_id:           '%env(VK_ID)%'
            client_secret:       '%env(VK_SECRET)%'
            scope:               'email'
            options:
                csrf: false

hwi_oauth_routing.yaml:
vkontakte_login:
    path: /login/check-vkontakte

security.yaml:
main:
            anonymous: ~
            provider: users
            guard:
                authenticators:
                    - App\Security\LoginFormAuthenticator
            oauth:
                resource_owners:
                    facebook:           "/login/check-facebook"
                    google:             "/login/check-google"
                    vkontakte:          "/login/check-vkontakte"
                login_path:        /login
                use_forward:       false
                failure_path:      /login
                provider: users
                oauth_user_provider:
                    service: app.provider.oauth
            logout:
                path:    app_logout

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2019-09-11
@Morilon

Symphony settings have nothing to do with it)) Naturally, it will not work, instead of localhost, specify your domain. Set up virtual hosts. Most likely the problem will be solved. It is necessary to send to the specified domain in the VK settings and the request is already sent to this domain

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question