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

No route found for "GET /connect" #872

Closed
Glideh opened this issue Sep 17, 2015 · 1 comment
Closed

No route found for "GET /connect" #872

Glideh opened this issue Sep 17, 2015 · 1 comment

Comments

@Glideh
Copy link

Glideh commented Sep 17, 2015

I'm trying to authenticate users from a custom OAuth2 server implementation (actually FOSOAuthServerBundle)

When I'm not authenticated, I'm getting redirected to /connect which doesn't match any route:

No route found for "GET /connect"
#116 is suggesting to implement OAuthAwareUserProviderInterface but I'm already using the default hwi_oauth.user.provider which should be ok for me as I don't need persist the users.

Here is my configuration:
security.yml

security:
#...
    firewalls:
#...
        main:
            pattern:    ^/
            oauth:
                resource_owners:
                    myoauth: "/login/check-myoauth"
                oauth_user_provider:
                    service: hwi_oauth.user.provider
                login_path: /connect
#...

config.yml

#...
hwi_oauth:
    firewall_name: main
    resource_owners:
        myoauth:
            type:                oauth2
            client_id:           <client_id>
            client_secret:       <client_secret>
            access_token_url:    '%myoauth_host%/oauth/v2/token'
            authorization_url:   '%myoauth_host%/oauth/v2/authorize'
            infos_url:           '%myoauth_host%/api/user'
            scope:               'read'
            user_response_class: HWI\Bundle\OAuthBundle\OAuth\Response\PathUserResponse
            paths:
                identifier: id
                nickname:   username
                realname:   fullname

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
#...

Why am I getting redirected to /connect and what could I have forgotten ?

@Glideh
Copy link
Author

Glideh commented Sep 18, 2015

I don't know where I copy/pasted

security:
    firewalls:
        main:
            pattern:    ^/
            oauth:
                login_path: /connect

but this was obviously generating the redirection. For my case I should have used /connect/myoauth

@Glideh Glideh closed this as completed Sep 18, 2015
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

1 participant