ユーザ名/パスワードの認証情報を入力する標準ダイアログを始める.
AuthenticationDialog["type"]
指定された標準タイプの認証ダイアログを始める.
AuthenticationDialog[{"key1","key2", …}]
指定されたキーの値を要求する認証ダイアログを始める.
AuthenticationDialog[arg,func]
関数 func をダイアログの戻り値に適用する.
AuthenticationDialog
ユーザ名/パスワードの認証情報を入力する標準ダイアログを始める.
AuthenticationDialog["type"]
指定された標準タイプの認証ダイアログを始める.
AuthenticationDialog[{"key1","key2", …}]
指定されたキーの値を要求する認証ダイアログを始める.
AuthenticationDialog[arg,func]
関数 func をダイアログの戻り値に適用する.
詳細とオプション
- type の可能な値には次がある.
-
"UsernamePassword" ユーザ名とパスワードのフィールドがあるダイアログ "Password" パスワードのフィールドがあるダイアログ "PermissionsKey" PermissionsKeyを入力するためのダイアログ "SecuredAuthenticationKey" SecuredAuthenticationKeyを入力するためのダイアログ - AuthenticationDialog[]は,タイプ"UsernamePassword"のダイアログを表示する.
- AuthenticationDialog[arg]はAuthenticationDialog[arg,Identity]に等しい.
- パスワードフィールドは,自動的にFieldMaskedを使ってダイアログ表示のコンテンツをマスクする.
- ユーザがダイアログをキャンセルすると,AuthenticationDialogは,たとえ関数 func が指定されていても,$Canceledを返す.
- AuthenticationDialog["PermissionsKey"]はPermissionsKey式を返す.
- AuthenticationDialog["SecuredAuthenticationKey"]はSecuredAuthenticationKey式を返す.
- 他のすべてのダイアログタイプはAssociationを返す.
- AuthenticationDialogが評価されているWolfram言語カーネルは,ダイアログが終了するまでブロックする.
- フロントエンドがない場合は,AuthenticationDialogは標準的な出力を書き出し,標準的な入力から読み込む.
- AuthenticationDialog["type"->{"key1"->"init1",…}]とAuthenticationDialog[{"key1"->"init1",…}]の形式を使って,任意のフィールドの初期値を指定することができる.
- オプション設定のSystemCredentialKey"name"を使うと,$SystemCredentialStoreが与える現行のキーリングにデータを安全に記憶させることができる.
- "key1"->"init1"->"Masked"で指定されたフィールドのコンテンツは,マスクされる.
- ダイアログ中の任意の形式を表示するためにAuthenticationDialog[FormObject[…]]がサポートされているプラットフォームもある.
- AuthenticationDialogは,ノートブックオプションとAppearanceRulesを取ることができる.
- AppearanceRulesを使って,タイトルや説明的なテキストを含むダイアログの全体的な外観を指定することができる.
- デフォルトで,AuthenticationDialogはメインの表示スクリーンの真ん中にダイアログを置く.これは,WindowMarginsを明示的に設定するとオーバーライドされる.
例題
すべて開く すべて閉じる例 (4)
AuthenticationDialog[]AuthenticationDialog["Password"]AuthenticationDialog["Password", Hash[#Password]&]AuthenticationDialog["SecuredAuthenticationKey", AppearanceRules -> <|"Description" -> "Please enter your OAuth information for that service."|>]スコープ (7)
AuthenticationDialog["UsernamePassword" -> {"Username" -> "matt"}]結果のAssociationを処理する関数を指定する:
AuthenticationDialog[{"Username" -> "matt", "Password", "Password hint" -> "first pet's name"}, Delete[#, "Password hint"]&]カスタムのキー名を,任意の初期値とマスキングを指定して使う:
AuthenticationDialog[{"Public key", "Private key" -> "12345" -> "Masked"}]SystemCredentialKey"name"を使ってセッション間でダイアログフィールドを安全に保存する.データは与えられた名前で保存される:
AuthenticationDialog[{"Public key", "Private key" -> "12345" -> "Masked"}, SystemCredentialKey -> "Example1"]SystemCredential["Example1"]他のタイプのコントロールや任意のフィールド等にFormObjectを使う:
AuthenticationDialog[FormObject[{"Username" -> "String", "Password" -> <|"Masked" -> True|>, "Password hint" -> <|"Required" -> False, "Hint" -> "(optional)"|>}]]スタンドアロンのWolfram言語カーネルでAuthenticationDialogを使う:
$ ./WolframKernel
Wolfram 15.0.0 Kernel for Mac OS X x86 (64-bit)
Copyright 1988-2026 Wolfram Research, Inc.
In[1]:= AuthenticationDialog[]
Username: matt
Password: *****
Out[1]= <|Username -> matt, Password -> 12345|>
wolframscriptでAuthenticationDialogを使う:
$ wolframscript -code "AuthenticationDialog[]"
Username: matt
Password: *****
<|Username -> matt, Password -> 12345|>
$
一般化と拡張 (1)
SystemCredentialKeyオプションと一緒に使うと,"UsernamePassword" AuthenticationDialogには追加的な特徴がある.フィールドは事前に提供された各ユーザ名について保存される:
AuthenticationDialog["UsernamePassword", SystemCredentialKey -> "Mydomain"]AuthenticationDialog["UsernamePassword", SystemCredentialKey -> "Mydomain"]新たなダイアログには最後に使った認証情報が自動的に書き込まれる.パスワードフィールドはドロップダウンメニューから項目を選んだ後で自動的に埋められる:
AuthenticationDialog["UsernamePassword", SystemCredentialKey -> "Mydomain"][image]全ユーザ名の項目はベースユーザ名から派生した名前で安全なストレージに保存される:
SystemCredentialKeys["Mydomain/*"]{"Mydomain/user1", "Mydomain/user2"}オプション (7)
AppearanceRules (3)
AuthenticationDialog[ "UsernamePassword", AppearanceRules -> {"Description" -> "That service requires you to log in."}]AuthenticationDialog[{"Username", "Password", "Comments"}, AppearanceRules -> {"Title" -> "Please login", "Description" -> "That service requires you to log in."}]AuthenticationDialog["PermissionsKey", AppearanceRules -> {"SubmitLabel" -> "Continue"}]SystemCredentialKey (2)
SystemCredentialKeyを使ってセッション間でダイアログフィールドを安全に保存する:
AuthenticationDialog["Password", SystemCredentialKey -> "UniqueDomainName"][image]前と同じドメインを使って保存されたフィールドの値を取り出す:
AuthenticationDialog["Password", SystemCredentialKey -> "UniqueDomainName"]WindowMargins (1)
WindowTitle (1)
WindowTitleやその他のノートブックオプションを使って,ダイアログノートブックウィンドウの縦横比を調整する:
AuthenticationDialog["UsernamePassword", WindowTitle -> "Authentication Required",
WindowSize -> {350, FitAll},
WindowFrameElements -> {"CloseBox", "ResizeArea"},
WindowElements -> {"MagnificationPopUp", "HorizontalScrollBar", "VerticalScrollBar"},
AppearanceRules -> <|"Description" -> TextGrid[{{"You are attempting to read from the url:"}, {Item[Hyperlink["https://..."], Alignment -> Center]}, {"and the server is requesting authentication. These values will be kept for this session only."}}, BaseStyle -> "FormDescription"],
"SubmitLabel" -> "Log in"|>]特性と関係 (2)
AuthenticationDialogをAuthenticationの設定として使って,必要な場合に認証情報を入力するように指示する:
URLRead["https://www.wolframcloud.com/obj/d1362db4-d2b4-492e-bc60-090170c44d22", "Content", Authentication -> AuthenticationDialog["PermissionsKey"]]AuthenticationDialogを使って,EncryptやDecrypt等の他の関数のパスワードをリクエストする:
Encrypt[AuthenticationDialog["Password", #Password&], "my data"]Decrypt[AuthenticationDialog["Password", #Password&], %]考えられる問題 (5)
プリエンプティブな制御はカーネルの評価キューをブロックできない:
Button["Authenticate…", AuthenticationDialog[]]常に,評価の待ち行列からAuthenticationDialogを呼び出す:
Button["Authenticate…", AuthenticationDialog[], Method -> "Queued"]AuthenticationDialogは,カーネル評価キューをブロックし,非同時の動的操作がレンダリングされないようにする:
myDescription[] := Style["That service requires you to log in.", "FormDescription"];
AuthenticationDialog["Password", AppearanceRules -> {"Description" -> Dynamic[myDescription[], SynchronousUpdating -> False]}]カーネル評価キューがブロックされている間は,同時の動的操作のみがレンダリングされる:
AuthenticationDialog["Password", AppearanceRules -> {"Description" -> Dynamic[myDescription[]]}]AuthenticationDialogは与えられたドメインのダイアログのキーと一致する任意のストアの認証情報を使う:
AuthenticationDialog["Password", SystemCredentialKey -> "NonUniqueDomain"]別の無関係の認証ダイアログが同じSystemCredentialKeyを使っている場合は,古い値が上書きされる:
AuthenticationDialog[{"NameField", "Password"}, SystemCredentialKey -> "NonUniqueDomain"]FormObjectを使う任意のAuthenticationDialogについてはSystemCredentialKeyは無視される:
AuthenticationDialog[FormObject[{"Username" -> "String", "Password" -> <|"Masked" -> True|>}], SystemCredentialKey -> "IAmIgnored"]スタンドアロンのWolfram言語カーネルのAuthenticationDialogについてはSystemCredentialKeyは無視される:
> wolfram
Wolfram 15.0.0 Kernel for Microsoft Windows (64-bit)
Copyright 1988-2026 Wolfram Research, Inc.
In[1]:= AuthenticationDialog["Password", SystemCredentialKey->"Domain"] Password: *** Out[1]= <|Password -> 123|>
関連するガイド
-
▪
- ダイアログボックス ▪
- クラウドのパーミッションの制御 ▪
- Webの操作 ▪
- URLの操作 ▪
- HTTPの要求と応答 ▪
- ユーザインタラクションの設定
テキスト
Wolfram Research (2018), AuthenticationDialog, Wolfram言語関数, https://reference.wolfram.com/language/ref/AuthenticationDialog.html (2020年に更新).
CMS
Wolfram Language. 2018. "AuthenticationDialog." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/AuthenticationDialog.html.
APA
Wolfram Language. (2018). AuthenticationDialog. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AuthenticationDialog.html
BibTeX
@misc{reference.wolfram_2026_authenticationdialog, author="Wolfram Research", title="{AuthenticationDialog}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/AuthenticationDialog.html}", note=[Accessed: 14-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_authenticationdialog, organization={Wolfram Research}, title={AuthenticationDialog}, year={2020}, url={https://reference.wolfram.com/language/ref/AuthenticationDialog.html}, note=[Accessed: 14-August-2026]}