# Market data websocket result in 402 auth failed

**URL:** <https://forum.alpaca.markets/t/market-data-websocket-result-in-402-auth-failed/6350>\
**Category:** Alpaca Market Data\
**Created:** [July 28, 2021, 2:47pm UTC](https://forum.alpaca.markets/t/market-data-websocket-result-in-402-auth-failed/6350 "2021-07-28T14:47:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiennt23](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/kiennt23/32/2887_2.png) [@kiennt23](https://forum.alpaca.markets/u/kiennt23)\
**Post date:** [July 28, 2021, 2:47pm UTC](https://forum.alpaca.markets/t/market-data-websocket-result-in-402-auth-failed/6350/1 "2021-07-28T14:47:48Z")

</div>

Hi,  
I have followed the the documentation here: [Real-time data - Documentation | Alpaca](https://alpaca.markets/docs/api-documentation/api-v2/market-data/alpaca-data-api-v2/real-time/), and authenticate using the client key and secret created here [Open an Alpaca Securities Brokerage Account](https://app.alpaca.markets/brokerage/apps/manage). However I received these series of events:

```auto
[{"T":"success","msg":"connected"}]
[{"T":"error","code":402,"msg":"auth failed"}]
[{"T":"error","code":401,"msg":"not authenticated"}]
[{"T":"error","code":404,"msg":"auth timeout"}]

```

May I know what I did wrong?

Thanks,  
Kien

---

<div class="post-metadata">

**Author:** ![Alphaunicorn](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/alphaunicorn/32/1678_2.png) [@Alphaunicorn](https://forum.alpaca.markets/u/Alphaunicorn)\
**Post date:** [October 29, 2021, 7:07am UTC](https://forum.alpaca.markets/t/market-data-websocket-result-in-402-auth-failed/6350/2 "2021-10-29T07:07:09Z")

</div>

> [@kiennt23](#):
>
> ```auto
> "auth timeout"}]
> 
> ```
> 
> May I know what I did wrong?

I am dealing with the same problem. I can connect just fine using a websocket client from chrome but using Golang client I cant. Have you found resolution with this? Seems no one responded.
