AzureAD / microsoft-identity-web

Helps creating protected web apps and web APIs with Microsoft identity platform and Azure AD B2C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HttpRequestException when DeserializeOutput is called

zetomatoz opened this issue · comments

Microsoft.Identity.Web Library

Microsoft.Identity.Web.DownstreamApi

Microsoft.Identity.Web version

2.19.0

Web app

Sign-in users and call web APIs

Web API

Protected web APIs call downstream web APIs

Token cache serialization

Not Applicable

Description

By design, DeserializeOutput checks that the HttpResponseMessage has a successful status code. If this is not the case, then an HttpRequestException is raised. This behavior does not relate to the deserialization and can be considered as misleading.

Reproduction steps

  1. A downstream api responds with a 500 error
  2. Any methods that accept TOutput in the partial class DownstreamApi.HttpMethods can raise an HttpRequestException when the response is being deserialized.

Error message

image

Id Web logs

No response

Relevant code snippets

N/A

Regression

No response

Expected behavior

When DeserializeOutput gets called, then exceptions thrown are only related to the deserialization process.