# Upgrade a http connection to websocket - auth

**URL:** <https://community.postman.com/t/upgrade-a-http-connection-to-websocket-auth/59625>\
**Category:** Help Hub\
**Tags:** authorization, oauth2, websockets\
**Created:** [April 5, 2024, 9:43am UTC](https://community.postman.com/t/upgrade-a-http-connection-to-websocket-auth/59625 "2024-04-05T09:43:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aerospace-astronaut6](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@aerospace-astronaut6](https://community.postman.com/u/aerospace-astronaut6)\
**Post date:** [April 5, 2024, 9:43am UTC](https://community.postman.com/t/upgrade-a-http-connection-to-websocket-auth/59625/1 "2024-04-05T09:43:46Z")

</div>

Hi Folks,

I’m building a software backend that contains an HTTP endpoint which can be upgraded to a WebSocket connection. I noticed the “WebSocket” connection type in Postman and was excited to test my WebSocket endpoint using Postman.

However, I encountered a small issue. My HTTP WebSocket endpoint is protected by an OAuth2 token check, which is applied to all HTTP endpoints in my application. Only logged-in and authorized users are allowed to create a WebSocket connection. The problem is that Postman doesn’t have a built-in authorization function for WebSocket connections. As a workaround, I have to manually copy the JWT token from my collection’s authorization tab and paste it into the header tab of my WebSocket connection, and I need to replace it every 5 minutes when the token expires.

This process is quite inconvenient and time-consuming. I was wondering if anyone has a better solution or knows of a way to automate the token refreshing process in Postman for WebSocket connections.

Any suggestions or insights would be greatly appreciated!

Thanks,  
T

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [May 5, 2024, 9:44am UTC](https://community.postman.com/t/upgrade-a-http-connection-to-websocket-auth/59625/2 "2024-05-05T09:44:03Z")

</div>

Closed on May 5, 2024, 9:44am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
