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

Problem configuring ThruwayBundle with FosUser #88

Open
Webonaute opened this issue Jun 13, 2018 · 2 comments
Open

Problem configuring ThruwayBundle with FosUser #88

Webonaute opened this issue Jun 13, 2018 · 2 comments

Comments

@Webonaute
Copy link

Webonaute commented Jun 13, 2018

I need a little help. It make 2 night I try to figure out what am I doing wrong.

For the the purpose of the test, I open 2 commands line.
Than I runbin/console thruway:router:start -vvv to start the server.
Than when I try to run the worker, with bin/console thruway:worker:start -vvv "default" I got error message wamp.error.not_authorized.

Look like internal client is running anonymous user.

So here is my config:
php7.2
symfony 4.0
ThruwayBundle dev-master

config/packages/security.yaml

security:

    encoders:
        FOS\UserBundle\Model\UserInterface:
            algorithm:            pbkdf2
            hash_algorithm:       sha256
            encode_as_base64:     true
            iterations:           1000
            key_length:           32

    role_hierarchy:
        ROLE_ADMIN:       ROLE_USER
        ROLE_SUPER_ADMIN: ROLE_ADMIN

    providers:
        fos_userbundle:
            id: fos_user.user_provider.username_email

    firewalls:
        thruway:
            security: false

        dev:
            pattern: ^/(_(profiler|wdt|error)|css|images|js)/
            security: false

        main:
            pattern: ^/
            form_login:
                provider: fos_userbundle
                csrf_token_generator: security.csrf.token_manager
            logout:       true
            anonymous:    true

config/packages/voryx_thruway.yaml

voryx_thruway:
    realm: 'realm1'
    url: '%env(VORYX_THRUWAY_URL)%' #The url that the clients will use to connect to the router
    router:
        ip: '%env(VORYX_THRUWAY_ROUTER_IP)%'  # the ip that the router should start on
        port: '%env(VORYX_THRUWAY_ROUTER_PORT)%'  # public facing port.  If authentication is enabled, this port will be protected
        trusted_port: '%env(VORYX_THRUWAY_ROUTER_TRUSTED_PORT)%' # Bypasses all authentication.  Use this for trusted clients.
        authentication: true
    user_provider: 'fos_user.user_provider.username_email'
    enable_logging: true

config/packages/fos_user.yaml

fos_user:
    db_driver: orm
    firewall_name: main
    user_class: App\Entity\User
    from_email:
        address: "%env(APP_EMAIL_FROM)%"
        sender_name: "%env(APP_EMAIL_NAME)%"

config/services.yaml

    wamp_cra_auth:
        class: Thruway\Authentication\WampCraAuthProvider
        parent: voryx.thruway.wamp.cra.auth.client
        autowire: false
        autoconfigure: false
        public: true
        tags:
            - { name: thruway.internal_client }
@Webonaute
Copy link
Author

I finally find my problem. thank to this article:
http://voryx.net/integrating-symfony-authentication-for-thruwaybundle/

@Webonaute
Copy link
Author

hum nvm external connection can connect using jwt token but but internal still get connection refused.

@Webonaute Webonaute reopened this Jun 14, 2018
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