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

12 ビュー (過去 30 日間)
MathWorks Support Team
MathWorks Support Team 2025 年 10 月 22 日 0:00
編集済み: MathWorks Support Team 2025 年 10 月 28 日 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? 

採用された回答

MathWorks Support Team
MathWorks Support Team 2025 年 10 月 28 日 0:00
編集済み: MathWorks Support Team 2025 年 10 月 28 日 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 件)

カテゴリ

Help Center および File ExchangeMATLAB Web App Server についてさらに検索

タグ

タグが未入力です。

製品


リリース

R2025b

Community Treasure Hunt

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

Start Hunting!

Translated by