compiler.UserInfo
説明
例
MATLAB コマンド プロンプトで、次を実行します。
user = compiler.UserInfo()
user =
UserInfo with properties:
UserID: 'someid'
DisplayName: <missing>
Groups: <missing>
Domain: 'SOME_DOMAIN'MATLAB Web App Server で詳細なユーザー情報を有効にするには、userinfo.json ファイルを作成して、webapps_private フォルダーに配置します。このファイルは、ID プロバイダー (IdP) のプロパティを MATLAB プロパティにマップし、そのデータにアクセスできるアプリを定義します。
{
"version": "1.0.0",
"userInfo.doc": "Property values to be fetched during login from IdP",
"userInfo": {
"UserID": "upn",
"DisplayName": "displayName",
"Groups": "groups",
"LastName": "surname",
"Email": "mail"
},
"appAccess.doc": "Policy for allowing access to user properties within an app or group of apps",
"appAccess": {
"Health/BloodPressure": ["UserID", "Email"],
"Finance/Mortgage": ["UserID", "LastName"],
"Mystery": ["UserID", "Email", "WebAppsRole"]
}
}appAccess オブジェクトのキーは、アプリのルート フォルダーに相対的な Web アプリの場所に対応します。アプリケーションがサブフォルダーに保存されている場合、マッピングにフォルダー パスを含める必要があります。
たとえば、BloodPressure アプリが Health という名前のフォルダー内に配置されている場合、JSON ファイル内のキーは "Health/BloodPressure" でなければなりません。アプリがルート アプリ フォルダー内に直接配置されている場合は、アプリ名のみ ("Mystery" など) を使用します。
App Designer アプリの startupFcn 内で compiler.UserInfo 関数を使用して、アプリをカスタマイズします。
function startupFcn(app) try user = compiler.UserInfo(); catch me % Handle errors if the server is not configured for authentication return end if ~ismissing(user.UserID) app.WelcomeLabel.Text = "Welcome, " + user.UserID; end end
出力引数
返されるオブジェクトには、UserID、DisplayName、Groups などのプロパティおよび userinfo.json ファイル内で定義されている任意のカスタム属性が含まれます。特定のアプリにマップされていない、または許可されていないプロパティは、<missing> として返されます。
バージョン履歴
R2022a で導入
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)