How can I access secrets (MATLAB vault) in web apps?
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 22 Oct 2025 à 0:00
Modifié(e) : MathWorks Support Team
le 28 Oct 2025 à 16:19
I am deploying an app to MATLAB Web App Server that uses secrets. Currently, this works in my local MATLAB installation using setSecret and getSecret. How can I use these secrets when deploying this app as a web app on MATLAB Web App Server?
Réponse acceptée
MathWorks Support Team
le 28 Oct 2025 à 0:00
Modifié(e) : MathWorks Support Team
le 28 Oct 2025 à 16:19
There are a few options for this workflow.
Use MATLAB Web App Server's Secrets Vault (requires admin access)
As of R2024a, MATLAB Web App Server maintains its own server-side secrets vault. A server administrator can add, remove, and implement access control for secrets on supported releases. Refer to the following documentation for more information:
Use Environment Variables
Your web app can access secrets stored as environment variables either on your server machine or packaged with your app. Packaging environment variables with your app (as an .env file) and loading them at app startup can be a great option if you do not have access to the server machine. For more information, refer to the documentation:
Package Code with Secrets
As of R2024b, you can package MATLAB vault secrets with your web app using a secrets manifest JSON file. This file can be included during compilation by specifying the path as the SecretsManifest name-value argument with compiler.build.webAppArchive. For more information, see:
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur MATLAB Web App Server dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!