Loading
The Trailblazer Community is now read-only Read More
Agentforce and Einstein Generative AI
Configure WebSocket Authentication for Agentforce Voice

Configure WebSocket Authentication for Agentforce Voice

Configure the JSON Web Token (JWT) that Amazon Connect sends to secure the WebSocket connection for Agentforce Voice with Real-Time Streaming. If you are a Salesforce Voice with Telephony Providers customer, Salesforce rotates the token and stores it in AWS Secrets Manager. If you aren’t, deploy SalesforceJwtRotatorNonScvStack and replace the private-key placeholder. Save the token secret’s ARN for the agent-to-agent application.

When a call enters Amazon Connect, Amazon Connect opens a real-time connection to Salesforce and routes the call to the Agentforce agent. To secure the connection, Amazon Connect sends an API key (referred to by Salesforce as a JWT token) and stores it in AWS Secrets Manager. The token authenticates requests from your Amazon Connect instance. Authentication steps vary depending on whether you use Salesforce Voice with Telephony Providers.

Websocket Authentication for Salesforce Voice with Telephony Providers Customers

If you are a Salesforce Voice with Telephony Providers customer, Salesforce provides the JSON Web Token (JWT) that secures the WebSocket connection for Agentforce Voice with Real-Time Streaming. Starting in contact center version 22.1, the JwtTokenRotatorFunction Lambda Function writes a new 60-minute token to <identity>-salesforce-jwt-secret every 55 minutes. Use that secret’s ARN when you register the agent-to-agent application that points Amazon Connect to the Agentforce WebSocket URL.

See Also

WebSocket Authentication for non-Salesforce Voice with Telephony Providers Customers

If you aren’t a Salesforce Voice with Telephony Providers customer, deploy SalesforceJwtRotatorNonScvStack in the same AWS account and region as the instance. The stack’s rotator creates the JSON Web Token (JWT) that secures the WebSocket connection for Agentforce Voice with Real-Time Streaming. Set the instance ID, the org ID, and the Call Center or Messaging channel name. After the stack is created, replace the private-key placeholder. After the rotator runs, use the ARN of <identity>-salesforce-jwt-secret when you register the A2A application. The token includes the roles claim set to voiceagent.

The stack creates these resources.

  • KMS key. A customer-managed AWS Key Management Service (KMS) key encrypts the secrets. The key policy allows your account root, and it allows Amazon Connect to decrypt for this instance only.
  • Secrets. <identity>-salesforce-secret stores the org ID, the Call Center or Messaging channel name, and the private key. <identity>-salesforce-jwt-secret stores the current JWT.
  • JwtTokenRotatorFunction. An EventBridge rule runs this Lambda function every 55 minutes. Each run signs a new RS256 JWT and writes it to the JWT secret.
  • SecretConfigurator. This Lambda function fills in the secrets during deployment and keeps a private key you already set when you update the stack. The stack also creates the IAM roles and the Lambda layer the functions use.

See Also

  • Configure WebSocket Authentication If You Are a Salesforce Voice with Telephony Providers Customer
    If you are a Salesforce Voice with Telephony Providers customer, Salesforce manages the token for you. The JwtTokenRotatorFunction Lambda function runs every 55 minutes and writes a new 60-minute token to <identity>-salesforce-jwt-secret.
  • Configure WebSocket Authentication If You Aren’t a Salesforce Voice with Telephony Providers Customer
    If you aren’t a Salesforce Voice with Telephony Providers customer, deploy the SalesforceJwtRotatorNonScvStack CloudFormation stack to the same AWS account and region as the instance. Set the instance, org, and channel parameters. After the stack is created, replace the private-key placeholder in the <identity>-salesforce-secret secret with your RSA private key. Then run the rotator and confirm that the JWT secret contains a token before you use its ARN. The rotator generates the token, rotates it every 55 minutes, and writes the latest token into the JWT secret. Use that secret’s ARN when you register the agent-to-agent application.
 
Loading
Salesforce Help | Article