Upgrade a http connection to websocket - auth

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!


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