Hello Christian Saiki,
Thank you for posting your question in the Microsoft Q&A forum.
Azure's WebRTC real-time communication does support ephemeral tokens for secure WebSocket connections, but implementation differs from OpenAI's API. While OpenAI generates ephemeral tokens directly for WebSocket auth, Azure requires explicit token service integration (e.g., Azure Communication Services or custom token providers) to issue short-lived credentials.
To connect via WebSockets you may try below configs:
- Use Azure Communication Services (ACS) or Azure SignalR for built-in token generation (CommunicationUserToken).
- Configure CORS and auth policies in your WebSocket server to validate tokens.
- Leverage Azure AD B2C for custom ephemeral tokens if using third-party WebRTC solutions.
For gaps in documentation, file a feature request or check ACS SDK samples for WebSocket workflows.
Some documentations for reference:
https://learn.microsoft.com/en-us/azure/azure-signalr/signalr-concept-authenticate-oauth
https://learn.microsoft.com/en-us/azure/communication-services/concepts/authentication
If the above answer helped, please do not forget to "Accept Answer" as this may help other community members to refer the info if facing a similar issue. Your contribution to the Microsoft Q&A community is highly appreciated.