/// <summary> /// Gets a flag that indicates if OAuth is enabled for the given Azure endpoint type. /// </summary> /// <param name="authEndpoint"><see cref="AzureAuthenticationEndpoints"/> value that indicates the endpoint type to check.</param> /// <returns>A flag that indicates if OAuth is enabled for this endpoint type.</returns> public bool OAuthEnabled(AzureAuthenticationEndpoints authEndpoint) { if (authEndpoint == AzureAuthenticationEndpoints.ManagementApi) { return(EnableOAuthForManagementApi); } if (authEndpoint == AzureAuthenticationEndpoints.Apim) { return(EnableOAuthForApim); } if (authEndpoint == AzureAuthenticationEndpoints.LogicApps) { return(EnableOAuthForLogicApps); } return(false); }
/// <summary> /// Initializes an instance of the <see cref="ApimRestClient"/> class. /// </summary> /// <param name="requestDetails"><see cref="RequestDetails"/> instance containing details about the request.</param> /// <param name="authEndpoint"><see cref="AzureAuthenticationEndpoints"/> value indicating the type of endpoint we're authenticating against.</param> /// <param name="authenticationScope">Authentication scope to use.</param> public AzureRestClient(RequestDetails requestDetails, AzureAuthenticationEndpoints authEndpoint, string authenticationScope = DefaultAuthenticationScope) : this() { _requestDetails = requestDetails; _authenticationScope = authenticationScope; _authenticationEndpoint = authEndpoint; }