2

このエラーは、/login ルートからの HWIOAuthBundle によって発生します。

HWIOAuthBundle:Connect:login.html.twig の 8 行目で、テンプレートのレンダリング中に例外がスローされました (「'google' という名前のリソース所有者はいません。」)。

どこにも言及していないのに「google」について不平を言う理由は明らかではありませんが、現時点ではfacbook接続をフックしています. 同じ人に会った人いますか?

[1] Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("No resource owner with name 'google'.") in "HWIOAuthBundle:Connect:login.html.twig" at line 8.
at n/a
    in E:\Projects\my_project\Symfony\app\cache\prod\classes.php line 4402

at Twig_Template->displayWithErrorHandling(array('error' => '', 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => false), 'app' => object(GlobalVariables)), array('hwi_oauth_content' => array(object(__TwigTemplate_f3c394f478b279ade4dd2d3ac458b9a9dd4ddb7db22da21707e88d9a5885896e), 'block_hwi_oauth_content')))
    in E:\Projects\my_project\Symfony\app\cache\prod\classes.php line 4372

at Twig_Template->display(array('error' => '', 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => false), 'app' => object(GlobalVariables)), array('hwi_oauth_content' => array(object(__TwigTemplate_f3c394f478b279ade4dd2d3ac458b9a9dd4ddb7db22da21707e88d9a5885896e), 'block_hwi_oauth_content')))
    in E:\Projects\my_project\Symfony\app\cache\prod\twig\f3\c3\94f478b279ade4dd2d3ac458b9a9dd4ddb7db22da21707e88d9a5885896e.php line 24

at __TwigTemplate_f3c394f478b279ade4dd2d3ac458b9a9dd4ddb7db22da21707e88d9a5885896e->doDisplay(array('error' => '', 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => false), 'app' => object(GlobalVariables)), array())
    in E:\Projects\my_project\Symfony\app\cache\prod\classes.php line 4391

at Twig_Template->displayWithErrorHandling(array('error' => '', 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => false), 'app' => object(GlobalVariables)), array())
    in E:\Projects\my_project\Symfony\app\cache\prod\classes.php line 4372

at Twig_Template->display(array('error' => ''))
    in E:\Projects\my_project\Symfony\app\cache\prod\classes.php line 4379

at Twig_Template->render(array('error' => ''))
    in E:\Projects\my_project\Symfony\vendor\symfony\symfony\src\Symfony\Bridge\Twig\TwigEngine.php line 53

at Symfony\Bridge\Twig\TwigEngine->render('HWIOAuthBundle:Connect:login.html.twig', array('error' => ''))
    in E:\Projects\my_project\Symfony\vendor\symfony\symfony\src\Symfony\Bundle\TwigBundle\TwigEngine.php line 79

at Symfony\Bundle\TwigBundle\TwigEngine->render('HWIOAuthBundle:Connect:login.html.twig', array('error' => ''))
    in E:\Projects\my_project\Symfony\vendor\symfony\symfony\src\Symfony\Bundle\TwigBundle\Debug\TimedTwigEngine.php line 52

at Symfony\Bundle\TwigBundle\Debug\TimedTwigEngine->render('HWIOAuthBundle:Connect:login.html.twig', array('error' => ''))
    in E:\Projects\my_project\Symfony\vendor\symfony\symfony\src\Symfony\Bundle\TwigBundle\TwigEngine.php line 108

at Symfony\Bundle\TwigBundle\TwigEngine->renderResponse('HWIOAuthBundle:Connect:login.html.twig', array('error' => ''))
    in E:\Projects\my_project\Symfony\vendor\hwi\oauth-bundle\HWI\Bundle\OAuthBundle\Controller\ConnectController.php line 71

at HWI\Bundle\OAuthBundle\Controller\ConnectController->connectAction(object(Request))
    in  line 

at call_user_func_array(array(object(ConnectController), 'connectAction'), array(object(Request)))
    in E:\Projects\my_project\Symfony\app\bootstrap.php.cache line 2844

at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), '1')
    in E:\Projects\my_project\Symfony\app\bootstrap.php.cache line 2818

at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), '1', true)
    in E:\Projects\my_project\Symfony\app\bootstrap.php.cache line 2947

at Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle(object(Request), '1', true)
    in E:\Projects\my_project\Symfony\app\bootstrap.php.cache line 2249

at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
    in E:\Projects\my_project\Symfony\web\app.php line 23

[2] RuntimeException: 'google' という名前のリソース所有者がいません。E:\Projects\my_project\Symfony\vendor\hwi\oauth-bundle\HWI\Bundle\OAuthBundle\Security\OAuthUtils.php 行 220 の該当なし

at HWI\Bundle\OAuthBundle\Security\OAuthUtils->getResourceOwner('google')
    in E:\Projects\my_project\Symfony\vendor\hwi\oauth-bundle\HWI\Bundle\OAuthBundle\Security\OAuthUtils.php line 114

at HWI\Bundle\OAuthBundle\Security\OAuthUtils->getLoginUrl(object(Request), 'google')
    in E:\Projects\my_project\Symfony\vendor\hwi\oauth-bundle\HWI\Bundle\OAuthBundle\Templating\Helper\OAuthHelper.php line 69

at HWI\Bundle\OAuthBundle\Templating\Helper\OAuthHelper->getLoginUrl('google')
    in E:\Projects\my_project\Symfony\vendor\hwi\oauth-bundle\HWI\Bundle\OAuthBundle\Twig\Extension\OAuthExtension.php line 63

at HWI\Bundle\OAuthBundle\Twig\Extension\OAuthExtension->getLoginUrl('google')
    in E:\Projects\my_project\Symfony\app\cache\prod\twig\f3\c3\94f478b279ade4dd2d3ac458b9a9dd4ddb7db22da21707e88d9a5885896e.php line 46

at __TwigTemplate_f3c394f478b279ade4dd2d3ac458b9a9dd4ddb7db22da21707e88d9a5885896e->block_hwi_oauth_content(array('error' => '', 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => false), 'app' => object(GlobalVariables)), array())
    in  line 

at call_user_func(array(object(__TwigTemplate_f3c394f478b279ade4dd2d3ac458b9a9dd4ddb7db22da21707e88d9a5885896e), 'block_hwi_oauth_content'), array('error' => '', 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => false), 'app' => object(GlobalVariables)), array())
    in E:\Projects\my_project\Symfony\app\cache\prod\classes.php line 4339

at Twig_Template->displayBlock('hwi_oauth_content', array('error' => '', 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => false), 'app' => object(GlobalVariables)), array('hwi_oauth_content' => array(object(__TwigTemplate_f3c394f478b279ade4dd2d3ac458b9a9dd4ddb7db22da21707e88d9a5885896e), 'block_hwi_oauth_content')))
    in E:\Projects\my_project\Symfony\app\cache\prod\twig\c5\58\f7730812ef8717461bfd2081b2ec682a7210fca6c5a4d0e2ce5a1de9cab2.php line 29

at __TwigTemplate_c558f7730812ef8717461bfd2081b2ec682a7210fca6c5a4d0e2ce5a1de9cab2->doDisplay(array('error' => '', 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => false), 'app' => object(GlobalVariables)), array('hwi_oauth_content' => array(object(__TwigTemplate_f3c394f478b279ade4dd2d3ac458b9a9dd4ddb7db22da21707e88d9a5885896e), 'block_hwi_oauth_content')))
    in E:\Projects\my_project\Symfony\app\cache\prod\classes.php line 4391

at Twig_Template->displayWithErrorHandling(array('error' => '', 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => false), 'app' => object(GlobalVariables)), array('hwi_oauth_content' => array(object(__TwigTemplate_f3c394f478b279ade4dd2d3ac458b9a9dd4ddb7db22da21707e88d9a5885896e), 'block_hwi_oauth_content')))
    in E:\Projects\my_project\Symfony\app\cache\prod\classes.php line 4372

at Twig_Template->display(array('error' => '', 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => false), 'app' => object(GlobalVariables)), array('hwi_oauth_content' => array(object(__TwigTemplate_f3c394f478b279ade4dd2d3ac458b9a9dd4ddb7db22da21707e88d9a5885896e), 'block_hwi_oauth_content')))
    in E:\Projects\my_project\Symfony\app\cache\prod\twig\f3\c3\94f478b279ade4dd2d3ac458b9a9dd4ddb7db22da21707e88d9a5885896e.php line 24

at __TwigTemplate_f3c394f478b279ade4dd2d3ac458b9a9dd4ddb7db22da21707e88d9a5885896e->doDisplay(array('error' => '', 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => false), 'app' => object(GlobalVariables)), array())
    in E:\Projects\my_project\Symfony\app\cache\prod\classes.php line 4391

at Twig_Template->displayWithErrorHandling(array('error' => '', 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => false), 'app' => object(GlobalVariables)), array())
    in E:\Projects\my_project\Symfony\app\cache\prod\classes.php line 4372

at Twig_Template->display(array('error' => ''))
    in E:\Projects\my_project\Symfony\app\cache\prod\classes.php line 4379

at Twig_Template->render(array('error' => ''))
    in E:\Projects\my_project\Symfony\vendor\symfony\symfony\src\Symfony\Bridge\Twig\TwigEngine.php line 53

at Symfony\Bridge\Twig\TwigEngine->render('HWIOAuthBundle:Connect:login.html.twig', array('error' => ''))
    in E:\Projects\my_project\Symfony\vendor\symfony\symfony\src\Symfony\Bundle\TwigBundle\TwigEngine.php line 79

at Symfony\Bundle\TwigBundle\TwigEngine->render('HWIOAuthBundle:Connect:login.html.twig', array('error' => ''))
    in E:\Projects\my_project\Symfony\vendor\symfony\symfony\src\Symfony\Bundle\TwigBundle\Debug\TimedTwigEngine.php line 52

at Symfony\Bundle\TwigBundle\Debug\TimedTwigEngine->render('HWIOAuthBundle:Connect:login.html.twig', array('error' => ''))
    in E:\Projects\my_project\Symfony\vendor\symfony\symfony\src\Symfony\Bundle\TwigBundle\TwigEngine.php line 108

at Symfony\Bundle\TwigBundle\TwigEngine->renderResponse('HWIOAuthBundle:Connect:login.html.twig', array('error' => ''))
    in E:\Projects\my_project\Symfony\vendor\hwi\oauth-bundle\HWI\Bundle\OAuthBundle\Controller\ConnectController.php line 71

at HWI\Bundle\OAuthBundle\Controller\ConnectController->connectAction(object(Request))
    in  line 

at call_user_func_array(array(object(ConnectController), 'connectAction'), array(object(Request)))
    in E:\Projects\my_project\Symfony\app\bootstrap.php.cache line 2844

at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), '1')
    in E:\Projects\my_project\Symfony\app\bootstrap.php.cache line 2818

at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), '1', true)
    in E:\Projects\my_project\Symfony\app\bootstrap.php.cache line 2947

at Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle(object(Request), '1', true)
    in E:\Projects\my_project\Symfony\app\bootstrap.php.cache line 2249

at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
    in E:\Projects\my_project\Symfony\web\app.php line 23
4

2 に答える 2

8

oauth を正しく設定したい場合、上記の受け入れられた解決策は機能しません。

解決策は次のとおりです。

resource_owners:egの下のキーは、以下のようにとファイルのresowner_key1:両方で一致する必要があります。config.ymlsecurity.yml

あなたのconfig.ymlファイルで

hwi_oauth:
    # name of the firewall in which this bundle is active, this setting MUST be set
    firewall_name: open_auth

    resource_owners:
        resowner_key1:
            type:                facebook #e.g. facebook, google
            client_id:           <client_id>
            client_secret:       <secret_id>
            options:
                display: popup #dialog is optimized for popup window

そして、security.yml

open_auth:
    anonymous: ~
    oauth:
        resource_owners:
            resowner_key1:           "/login/check-facebook"
        login_path:        /login
        use_forward:       false
        failure_path:      /login

        oauth_user_provider:
            service: fos_user_provider
于 2014-09-30T17:41:01.407 に答える
2

セキュリティ構成ファイル (app/config/security.yml) を確認し、resource_owners セクションの下から「google」を削除します

于 2013-10-22T07:23:03.240 に答える