how check if user  is authorized
At the moment method `onOpen ` contains following code

```
public function onOpen(ConnectionInterface $conn)
 {
        // store the new connection
        $this->clients->attach($conn);
       // echo "someone connected\n";
}
```

I want to add autorization data (token) in order to ignore hacker requestes. 
How I want to do it:

method `onOpen` gets parameter "token" and checks if user is authorized. 
In case if user is crasher, the method doesn't  add this user to clients list. Thus unauthorized users will be not able to receive updates.

I know I can to do following

in javascript:

`new WebSocket('ws://server.com:8080?token=secret') `


in php:

```
public function onOpen(ConnectionInterface $conn)
{
    $querystring = $conn->httpRequest->getUri()->getQuery();
    parse_str($querystring,$queryarray);

    if(!isValid($queryarray['token'])) {
      return;
    }

    // store the new connection
    $this->clients->attach($conn);
    // echo "someone connected\n";
}
```

But I think it's not safe.
What do you think about it? Could you help me please?
Maybe there are other methods to check authorized users?