MicrosoftIdentityMessageHandlerOptions.Scopes Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the scopes to request for the token.
public System.Collections.Generic.IList<string> Scopes { get; set; }
member this.Scopes : System.Collections.Generic.IList<string> with get, set
Public Property Scopes As IList(Of String)
Property Value
A list of scopes required to access the target API. For instance, "user.read mail.read" for Microsoft Graph user permissions. For Microsoft Identity, in the case of application tokens (requested by the app on behalf of itself), there should be only one scope, and it should end with ".default" (e.g., "https://graph.microsoft.com/.default").
Examples
var options = new MicrosoftIdentityMessageHandlerOptions();
options.Scopes.Add("https://graph.microsoft.com/.default");
options.Scopes.Add("https://myapi.domain.com/access");
Remarks
This property must contain at least one scope, or the MicrosoftIdentityMessageHandler will throw a MicrosoftIdentityAuthenticationException when processing requests.