語言

RequiredScopeAttribute.RequiredScopesConfigurationKey 屬性

定義

包含所需作用域的配置鍵的完全限定名稱(以空格分隔)。

public string? RequiredScopesConfigurationKey { get; set; }
member this.RequiredScopesConfigurationKey : string with get, set
Public Property RequiredScopesConfigurationKey As String

屬性值

範例

如果 appsettings.json 檔案包含名為「AzureAd」的區段,其中一個名為「Scopes」的屬性包含所需的範圍,則要保護的控制器/頁面/動作上的屬性應設定為以下:

[RequiredScope(RequiredScopesConfigurationKey="AzureAd:Scopes")]

適用於