Share via


DownstreamWebApiGenericExtensions.PutForUserAsync Method

Definition

Overloads

PutForUserAsync<TInput>(IDownstreamWebApi, String, String, TInput, Action<DownstreamWebApiOptions>, ClaimsPrincipal, String)
Obsolete.

Calls the web API endpoint with an HttpPut, providing strongly typed input data.

PutForUserAsync<TOutput,TInput>(IDownstreamWebApi, String, String, TInput, Action<DownstreamWebApiOptions>, ClaimsPrincipal, String)
Obsolete.

Calls the web API endpoint with an HttpPut, provinding strongly typed input data and getting back strongly typed data.

PutForUserAsync<TInput>(IDownstreamWebApi, String, String, TInput, Action<DownstreamWebApiOptions>, ClaimsPrincipal, String)

Caution

Use IDownstreamApi.PutForUserAsync in Microsoft.Identity.Abstractions, implemented in Microsoft.Identity.Web.DownstreamApi.See aka.ms/id-web-downstream-api-v2 for migration details.

Calls the web API endpoint with an HttpPut, providing strongly typed input data.

[System.Obsolete("Use IDownstreamApi.PutForUserAsync in Microsoft.Identity.Abstractions, implemented in Microsoft.Identity.Web.DownstreamApi.See aka.ms/id-web-downstream-api-v2 for migration details.", false)]
public static System.Threading.Tasks.Task PutForUserAsync<TInput> (this Microsoft.Identity.Web.IDownstreamWebApi downstreamWebApi, string serviceName, string relativePath, TInput inputData, Action<Microsoft.Identity.Web.DownstreamWebApiOptions>? downstreamWebApiOptionsOverride = default, System.Security.Claims.ClaimsPrincipal? user = default, string? authenticationScheme = default);
[<System.Obsolete("Use IDownstreamApi.PutForUserAsync in Microsoft.Identity.Abstractions, implemented in Microsoft.Identity.Web.DownstreamApi.See aka.ms/id-web-downstream-api-v2 for migration details.", false)>]
static member PutForUserAsync : Microsoft.Identity.Web.IDownstreamWebApi * string * string * 'Input * Action<Microsoft.Identity.Web.DownstreamWebApiOptions> * System.Security.Claims.ClaimsPrincipal * string -> System.Threading.Tasks.Task
<Extension()>
Public Function PutForUserAsync(Of TInput) (downstreamWebApi As IDownstreamWebApi, serviceName As String, relativePath As String, inputData As TInput, Optional downstreamWebApiOptionsOverride As Action(Of DownstreamWebApiOptions) = Nothing, Optional user As ClaimsPrincipal = Nothing, Optional authenticationScheme As String = Nothing) As Task

Type Parameters

TInput

Input type.

Parameters

downstreamWebApi
IDownstreamWebApi

The downstream web API.

serviceName
String

Name of the service describing the downstream web API. There can be several configuration named sections mapped to a DownstreamWebApiOptions, each for one downstream web API. You can pass-in null, but in that case downstreamWebApiOptionsOverride needs to be set.

relativePath
String

Path to the API endpoint relative to the base URL specified in the configuration.

inputData
TInput

Input data sent to the API.

downstreamWebApiOptionsOverride
Action<DownstreamWebApiOptions>

Overrides the options proposed in the configuration described by serviceName.

user
ClaimsPrincipal

[Optional] Claims representing a user. This is useful in platforms like Blazor or Azure Signal R, where the HttpContext is not available. In other platforms, the library will find the user from the HttpContext.

authenticationScheme
String

Authentication scheme. If null, will use OpenIdConnectDefault.AuthenticationScheme if called from a web app, and JwtBearerDefault.AuthenticationScheme if called from a web API.

Returns

The value returned by the downstream web API.

Attributes

Applies to

PutForUserAsync<TOutput,TInput>(IDownstreamWebApi, String, String, TInput, Action<DownstreamWebApiOptions>, ClaimsPrincipal, String)

Caution

Use IDownstreamApi.PutForUserAsync in Microsoft.Identity.Abstractions, implemented in Microsoft.Identity.Web.DownstreamApi.See aka.ms/id-web-downstream-api-v2 for migration details.

Calls the web API endpoint with an HttpPut, provinding strongly typed input data and getting back strongly typed data.

[System.Obsolete("Use IDownstreamApi.PutForUserAsync in Microsoft.Identity.Abstractions, implemented in Microsoft.Identity.Web.DownstreamApi.See aka.ms/id-web-downstream-api-v2 for migration details.", false)]
public static System.Threading.Tasks.Task<TOutput?> PutForUserAsync<TOutput,TInput> (this Microsoft.Identity.Web.IDownstreamWebApi downstreamWebApi, string serviceName, string relativePath, TInput inputData, Action<Microsoft.Identity.Web.DownstreamWebApiOptions>? downstreamWebApiOptionsOverride = default, System.Security.Claims.ClaimsPrincipal? user = default, string? authenticationScheme = default) where TOutput : class;
[<System.Obsolete("Use IDownstreamApi.PutForUserAsync in Microsoft.Identity.Abstractions, implemented in Microsoft.Identity.Web.DownstreamApi.See aka.ms/id-web-downstream-api-v2 for migration details.", false)>]
static member PutForUserAsync : Microsoft.Identity.Web.IDownstreamWebApi * string * string * 'Input * Action<Microsoft.Identity.Web.DownstreamWebApiOptions> * System.Security.Claims.ClaimsPrincipal * string -> System.Threading.Tasks.Task<'Output (requires 'Output : null)> (requires 'Output : null)
<Extension()>
Public Function PutForUserAsync(Of TOutput As Class, TInput As Class) (downstreamWebApi As IDownstreamWebApi, serviceName As String, relativePath As String, inputData As TInput, Optional downstreamWebApiOptionsOverride As Action(Of DownstreamWebApiOptions) = Nothing, Optional user As ClaimsPrincipal = Nothing, Optional authenticationScheme As String = Nothing) As Task(Of TOutput)

Type Parameters

TOutput

Output type.

TInput

Input type.

Parameters

downstreamWebApi
IDownstreamWebApi

The downstream web API.

serviceName
String

Name of the service describing the downstream web API. There can be several configuration named sections mapped to a DownstreamWebApiOptions, each for one downstream web API. You can pass-in null, but in that case downstreamWebApiOptionsOverride needs to be set.

relativePath
String

Path to the API endpoint relative to the base URL specified in the configuration.

inputData
TInput

Input data sent to the API.

downstreamWebApiOptionsOverride
Action<DownstreamWebApiOptions>

Overrides the options proposed in the configuration described by serviceName.

user
ClaimsPrincipal

[Optional] Claims representing a user. This is useful in platforms like Blazor or Azure Signal R, where the HttpContext is not available. In other platforms, the library will find the user from the HttpContext.

authenticationScheme
String

Authentication scheme. If null, will use OpenIdConnectDefault.AuthenticationScheme if called from a web app, and JwtBearerDefault.AuthenticationScheme if called from a web API.

Returns

Task<TOutput>

A strongly typed response from the web API.

Attributes

Applies to