How can I access secrets (MATLAB vault) in web apps?

11 visualizzazioni (ultimi 30 giorni)
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? 

Risposta accettata

MathWorks Support Team
MathWorks Support Team circa 18 ore fa
Modificato: MathWorks Support Team circa un'ora fa
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:

Più risposte (0)

Categorie

Scopri di più su MATLAB Web App Server in Help Center e File Exchange

Tag

Non è stata ancora inserito alcun tag.

Prodotti


Release

R2025b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by