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

Error "Unable to find the controller for path …The route is wrongly configured." . How to configure the "check" Controller ? #1924

Open
damienfa opened this issue Oct 3, 2022 · 2 comments
Labels

Comments

@damienfa
Copy link

damienfa commented Oct 3, 2022

Q A
Bug? no
New Feature? no
Support question? yes
Version 2.x

My question

I don't understand that part of the documentation. Those routes are declared but do not target to any controller. Is this normal?
(see here)
image

My case and my issue

I confirmed everything as indicated in the documentation for Azure (resource owner). See below my security.yaml, hwi_oauth.yaml…

I successfully manage to be redirected to Azure in order to log in and, once logged, to be redirected back to my application on the "/login/check-azure" route (as indicated in my security.yaml).
The reply URL looks well in my browser :
http://localhost/login/check-azure?code=0.ATEA41mpfLamBE6PWLnLKh_fKxxxxxxxxx

⚠️ But I've got the Symfony error : "Unable to find the controller for path "/login/check-azure". The route is wrongly configured."
This does not surprise me too much because at no time is the controller defined for this route.
What part am I missing? 🤔

Thanks for your help

My config files

routes/hwi_oauth_routing.yaml :

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

hwi_oauth_connect:
    resource: "@HWIOAuthBundle/Resources/config/routing/connect.xml"
    prefix:   /connect

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

azure_login:
    path: /login/check-azure

config/hwi_oauth.yaml :

hwi_oauth:
    # list of names of the firewalls in which this bundle is active, this setting MUST be set
    firewall_names: [main]
    # https://github.com/hwi/HWIOAuthBundle/blob/master/Resources/doc/2-configuring_resource_owners.md
    resource_owners:
        azure:
            type: azure
            client_id: 70a35xxx-xxxx-xxxx-xxxx-xxxx 
            client_secret: xxxxxxxxxxxxxxx
            redirect_uri: xxxxxxxx
            options:
                application: xxxxxxxx
                scope: https://graph.microsoft.com/User.Read

config/security.yaml :

security:
    providers:
        users:
            entity:
                class: App\Entity\User
                property: email
    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
        main:
            pattern: ^/
            # Azure SSO (Oauth) 
            oauth:
                resource_owners:
                    azure: "/login/check-azure"
                login_path: "/redirect/azure"
                use_forward: false
                failure_path: "/login"

                oauth_user_provider:
                    service: App\Service\Security\AzureSamlUserProviderService
Copy link

Message to comment on stale issues. If none provided, will not mark issues stale

@github-actions github-actions bot added the Stale label Feb 23, 2024
@timwhite
Copy link

I was having a similar issue. It just needs to be an empty route like this (mine was in routes.yml):

azure_login:
    path: /login/check-azure

It gets picked up by a listener. It's important that client secret keys are defined though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants