Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Skip to main content
useServerChallengeReceived is a custom hook that handles mTLS (Mutual TLS) authentication in Vega apps. This hook manages certificate challenges from servers and provides methods to set client certificates for secure communication. The following shows how to import the hook.
The following shows how to to use the hook.

AuthCertParams

If you need to provide authentication certificates as part of your server challenge, use the AuthCertParams interface to define them.

Properties

  • url - The URL for which to set the certificates
  • clientCert - Path to the client certificate file
  • clientKey - Path to the client key file

Hook interface definition

The following shows the hook’s return type definition.

Configuration: required assets

Network security configuration

To provide rootCA certificates, create a network-config.json file in your project’s assets/raw directory with the following structure.
Note: Replace "127.0.0.1" with your target domain and adjust includeSubdomains as needed. Setting includeSubdomains to true applies the certificate configuration to the main domain and all its subdomains (For example, both example.com and api.example.com). Set it to false to restrict the configuration to only the exact domain specified.

Certificate Files

Place the following certificate files in your application’s assets/raw directory.
The following sample shows a basic mTLS Implementation.

Last modified on December 10, 2025