GOS WebSocket捆绑oAuth会话共享

时间:2017-06-16 08:11:48

标签: symfony fosuserbundle phpwebsocket fosoauthserverbundle

我使用symfony 3.3和WebSocketBundle 用于套接字消息和通知系统。 还使用了FOS oAuth和FOS用户包进行auth部分应用。

问题: 我想让用户进入主题。我尝试配置session sharing ...
一切正常..但这个totorial是共享的PHP会话。在我的项目中,我使用oAuth会话(使用oAuth访问tockens),我希望从oAuth会话中获取用户..我怎么能这样做?

<property>  
<name>yarn.scheduler.capacity.root.protegrity.default-node-label-expression</name>
<value>x</value> 
</property>

GOSWebSocketBundle配置

security:
encoders:
    FOS\UserBundle\Model\UserInterface: bcrypt

role_hierarchy:
    ROLE_ADMIN:       ROLE_USER
    ROLE_SUPER_ADMIN: ROLE_ADMIN

providers:
    fos_userbundle:
        id: fos_user.user_provider.username_email

firewalls:
    socket:
        pattern: ^/test/socket
        anonymous:    false
        fos_oauth:  true
    public:
        methods: [POST]
        pattern: ^/api/v1/users
        security: false
    oauth_token:
        pattern:    ^/oauth/v2/token
        security:   false

    oauth_authorize:
        pattern:    ^/oauth/v2/auth
        form_login:
            provider: fos_userbundle
            check_path: fos_user_security_check
            login_path: fos_user_security_login
    api:
        pattern:    ^/api
        fos_oauth:  true
        stateless:  true
        anonymous:  true # can be omitted as its default value

框架:     会议:         handler_id:session.handler.pdo

服务:

gos_web_socket:
server:
    port: 8080        #The port the socket server will listen on
    host: 127.0.0.1   #The host ip to bind to
    router:
        resources:
            - '@WebSocketsBundle/Resources/config/pubsub/routing.yml'
client:
    firewall: socket #can be an array of firewalls
    session_handler: '@session.handler.pdo'

0 个答案:

没有答案