2

I try 10 times to find out how to install HWIOAuthBundle But there is no enough documentation, I install the Bundle and I follow exactly the documentation in Git But it shows me this error:

InvalidConfigurationException: Unrecognized options "anonymous" under "security.firewalls.secured_area.oauth"

Somehow I didn't understand the Part A) 'Have a user provider that implements'.What should I do?Or where can I find easy documentation

A) Have a user provider that implements OAuthAwareUserProviderInterface

The bundle needs a service that is able to load users based on the user response of the oauth endpoint. If you have a custom service it should implement the interface: HWI\Bundle\OAuthBundle\Security\Core\User\OAuthAwareUserProviderInterface.

The HWIOAuthBundle also ships with three default implementations:

    OAuthUserProvider (service name: hwi_oauth.user.provider) - doesn't persist users
    EntityUserProvider (service name: hwi_oauth.user.provider.entity) - loads users from a database
    FOSUserBundle integration (service name: hwi_oauth.user.provider.fosub_bridge). Checkout the documentation for integrating HWIOAuthBundle with FOSUserBundle for more information: (todo)

what should I do here ?

Momo1987
  • 544
  • 6
  • 16
  • Seems you have some issue in `security.yml`, can you edit and add it here? – stloyd Sep 11 '13 at 07:58
  • I just copied and pasted this what in the documentation but I didn't understand the A part and I didn't do nothing as a service etc. here is the link: https://github.com/hwi/HWIOAuthBundle/blob/0.2/Resources/doc/3-configuring_the_security_layer.md – Momo1987 Sep 11 '13 at 13:25

3 Answers3

1

You should replace/comment out the line of the service:

oauth_user_provider:
    service: my.oauth_aware.user_provider.service

and then replace by:

oauth_user_provider:
    oauth: ~

Source: https://github.com/hwi/HWIOAuthBundle/issues/72

Go further:

Manu
  • 563
  • 1
  • 5
  • 18
0

Ahh, seems like a typo in docs, could you move that anonymous 4 spaces lower to something like:

# app/config/security.yml
security:
    firewalls:
        secured_area:
            anonymous: ~
            oauth:
                resource_owners:
                    facebook:      "/login/check-facebook"
                login_path:        /login
                failure_path:      /login

                oauth_user_provider:
                    service: my.oauth_aware.user_provider.service
stloyd
  • 422
  • 5
  • 11
  • 1
    But from where I get this service or just I should write like it is?I mean should I write somewhere else a service or some others code or just this is enough – Momo1987 Sep 12 '13 at 12:24
0

Easy fix for this is to define a service like this :

In security.yml keep this :

oauth_user_provider:
                service: my.oauth_aware.user_provider.service

In services.yml put this :

services:
my.oauth_aware.user_provider.service:
        class: HWI\Bundle\OAuthBundle\Security\Core\User\FOSUBUserProvider
        arguments:
            userManager: "@fos_user.user_manager"
            properties: ["pass properties as array"]

Thats it !

Tragaknight
  • 413
  • 4
  • 10