Language

DownstreamWebApi.CallWebApiForUserAsync メソッド

定義

オーバーロード

Name 説明
CallWebApiForUserAsync(String, String, Action<DownstreamWebApiOptions>, ClaimsPrincipal, StringContent)

構成内のダウンストリーム Web API の説明に基づいて、ユーザーのダウンストリーム Web API を呼び出します。

CallWebApiForUserAsync<TInput,TOutput>(String, TInput, String, Action<DownstreamWebApiOptions>, ClaimsPrincipal)

一部のデータで JSON を使用するダウンストリーム Web API を呼び出し、データを返します。

CallWebApiForUserAsync(String, String, Action<DownstreamWebApiOptions>, ClaimsPrincipal, StringContent)

構成内のダウンストリーム Web API の説明に基づいて、ユーザーのダウンストリーム Web API を呼び出します。

public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> CallWebApiForUserAsync(string serviceName, string? authenticationScheme, Action<Microsoft.Identity.Web.DownstreamWebApiOptions>? calledDownstreamWebApiOptionsOverride = default, System.Security.Claims.ClaimsPrincipal? user = default, System.Net.Http.StringContent? content = default);
abstract member CallWebApiForUserAsync : string * string * Action<Microsoft.Identity.Web.DownstreamWebApiOptions> * System.Security.Claims.ClaimsPrincipal * System.Net.Http.StringContent -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
override this.CallWebApiForUserAsync : string * string * Action<Microsoft.Identity.Web.DownstreamWebApiOptions> * System.Security.Claims.ClaimsPrincipal * System.Net.Http.StringContent -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
Public Function CallWebApiForUserAsync (serviceName As String, authenticationScheme As String, Optional calledDownstreamWebApiOptionsOverride As Action(Of DownstreamWebApiOptions) = Nothing, Optional user As ClaimsPrincipal = Nothing, Optional content As StringContent = Nothing) As Task(Of HttpResponseMessage)

パラメーター

serviceName
String

ダウンストリーム Web API を記述するサービスの名前。 1 つのダウンストリーム Web API に対して、 DownstreamWebApiOptionsにマップされた複数の構成の名前付きセクションを使用できます。 null を渡すことができますが、その場合 calledDownstreamWebApiOptionsOverride 設定する必要があります。

authenticationScheme
String

認証スキーム。 null の場合は、Web アプリから呼び出された場合は OpenIdConnectDefault.AuthenticationScheme、Web API から呼び出された場合は JwtBearerDefault.AuthenticationScheme が使用されます。

calledDownstreamWebApiOptionsOverride
Action<DownstreamWebApiOptions>

serviceNameで説明されている構成で提案されたオプションをオーバーライドします。

user
ClaimsPrincipal

[省略可能]ユーザーを表す要求。 これは、Blazor や Azure Signal R などのプラットフォームで役立ちます。HttpContext は使用できません。 他のプラットフォームでは、ライブラリは HttpContext からユーザーを見つけます。

content
StringContent

HttpMethodがPatch、Post、Putされている場合の HTTP コンテキスト。

返品

アプリケーションが処理する HttpResponseMessage 。

実装

適用対象

CallWebApiForUserAsync<TInput,TOutput>(String, TInput, String, Action<DownstreamWebApiOptions>, ClaimsPrincipal)

一部のデータで JSON を使用するダウンストリーム Web API を呼び出し、データを返します。

public System.Threading.Tasks.Task<TOutput?> CallWebApiForUserAsync<TInput,TOutput>(string serviceName, TInput input, string? authenticationScheme, Action<Microsoft.Identity.Web.DownstreamWebApiOptions>? downstreamWebApiOptionsOverride = default, System.Security.Claims.ClaimsPrincipal? user = default) where TOutput : class;
abstract member CallWebApiForUserAsync : string * 'Input * string * Action<Microsoft.Identity.Web.DownstreamWebApiOptions> * System.Security.Claims.ClaimsPrincipal -> System.Threading.Tasks.Task<'Output (requires 'Output : null)> (requires 'Output : null)
override this.CallWebApiForUserAsync : string * 'Input * string * Action<Microsoft.Identity.Web.DownstreamWebApiOptions> * System.Security.Claims.ClaimsPrincipal -> System.Threading.Tasks.Task<'Output (requires 'Output : null)> (requires 'Output : null)
Public Function CallWebApiForUserAsync(Of TInput, TOutput) (serviceName As String, input As TInput, authenticationScheme As String, Optional downstreamWebApiOptionsOverride As Action(Of DownstreamWebApiOptions) = Nothing, Optional user As ClaimsPrincipal = Nothing) As Task(Of TOutput)

型パラメーター

TInput

入力の種類。

TOutput

出力タイプ。

パラメーター

serviceName
String

ダウンストリーム Web API を記述するサービスの名前。 1 つのダウンストリーム Web API に対して、 DownstreamWebApiOptionsにマップされた複数の構成の名前付きセクションを使用できます。 null を渡すことができますが、その場合 downstreamWebApiOptionsOverride 設定する必要があります。

input
TInput

ダウンストリーム Web API への入力パラメーター。

authenticationScheme
String

認証スキーム。 null の場合は、Web アプリから呼び出された場合は OpenIdConnectDefault.AuthenticationScheme、Web API から呼び出された場合は JwtBearerDefault.AuthenticationScheme が使用されます。

downstreamWebApiOptionsOverride
Action<DownstreamWebApiOptions>

serviceNameで説明されている構成で提案されたオプションをオーバーライドします。

user
ClaimsPrincipal

[省略可能]ユーザーを表す要求。 これは、Blazor や Azure Signal R などのプラットフォームで役立ちます。HttpContext は使用できません。 他のプラットフォームでは、ライブラリは HttpContext からユーザーを見つけます。

返品

Task<TOutput>

ダウンストリーム Web API によって返される値。

実装

適用対象