Skip to main content

WebRTC credential authentication

The Telnyx WebRTC client connects your application to the Telnyx backend, enabling you to make outgoing calls and handle incoming calls. This guide covers the types of telephony credentials to authenticate WebRTC calls.

Telnyx provides three distinct types of telephony credentials to authenticate WebRTC calls, tailored to meet various business/use case needs.

SIP Connection credentials are the fundamental way to authenticate calls through Telnyx. Users can easily set up these credentials through the Telnyx portal by creating a SIP connection and customizing their username and password. This method is ideal for straightforward authentication, allowing for efficient call management and integration with various softphone clients.

On-demand credentials offer a dynamic approach to call authentication. Created via Telnyx Telephony Credential RESTful API, these credentials enable businesses to programmatically generate user-specific access for SIP connections. This feature is particularly beneficial for onboarding new users or customers, providing them with unique security credentials. However, it's important to note that these credentials are designed primarily for outbound calls, with inbound call functionality currently limited to direct SIP URI calling only.

Telnyx Access Tokens (JSON Web Tokens) provide a secure and temporary authentication method, generated through Telnyx access token API. These tokens, valid for 24 hours, offer a layer of security by ensuring temporary access. This is especially useful for granting temporary access to users or guests, allowing them to utilize WebRTC and VoIP services without compromising long-term security.

Each of these credential types serves different purposes, catering to various scenarios from simple call authentication to complex, programmable user access management. Whether you need persistent SIP connection credentials, flexible on-demand credentials for dynamic user management, or secure, temporary access via JWTs.

The relationship between a SIP connection, on-demand credentials, and access tokens is such that a SIP connection would typically be an overarching organization (ABC Corporation), the on-demand credential would be a specific user or agent within the organization (ABC Corporation Agent) and an access token would be the way the agent is authenticated.

Telnyx recommends the use of access tokens whenever possible.