@@ -65,12 +65,12 @@ protected override async Task<OAuthTokenResponse> ExchangeCodeAsync([NotNull] OA
6565 "returned a {Status} response with the following payload: {Headers} {Body}." ,
6666 /* Status: */ response . StatusCode ,
6767 /* Headers: */ response . Headers . ToString ( ) ,
68- /* Body: */ await response . Content . ReadAsStringAsync ( ) ) ;
68+ /* Body: */ await response . Content . ReadAsStringAsync ( Context . RequestAborted ) ) ;
6969
7070 return OAuthTokenResponse . Failed ( new Exception ( "An error occurred while retrieving an access token." ) ) ;
7171 }
7272
73- var payload = JsonDocument . Parse ( await response . Content . ReadAsStringAsync ( ) ) ;
73+ var payload = JsonDocument . Parse ( await response . Content . ReadAsStringAsync ( Context . RequestAborted ) ) ;
7474 return OAuthTokenResponse . Success ( payload ) ;
7575 }
7676
@@ -90,12 +90,12 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
9090 "returned a {Status} response with the following payload: {Headers} {Body}." ,
9191 /* Status: */ response . StatusCode ,
9292 /* Headers: */ response . Headers . ToString ( ) ,
93- /* Body: */ await response . Content . ReadAsStringAsync ( ) ) ;
93+ /* Body: */ await response . Content . ReadAsStringAsync ( Context . RequestAborted ) ) ;
9494
9595 throw new HttpRequestException ( "An error occurred while retrieving user information." ) ;
9696 }
9797
98- using var payload = JsonDocument . Parse ( await response . Content . ReadAsStringAsync ( ) ) ;
98+ using var payload = JsonDocument . Parse ( await response . Content . ReadAsStringAsync ( Context . RequestAborted ) ) ;
9999 var principal = new ClaimsPrincipal ( identity ) ;
100100 var context = new OAuthCreatingTicketContext ( principal , properties , Context , Scheme , Options , Backchannel , tokens , payload . RootElement ) ;
101101 context . RunClaimActions ( ) ;
@@ -134,12 +134,12 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
134134 "the remote server returned a {Status} response with the following payload: {Headers} {Body}." ,
135135 /* Status: */ response . StatusCode ,
136136 /* Headers: */ response . Headers . ToString ( ) ,
137- /* Body: */ await response . Content . ReadAsStringAsync ( ) ) ;
137+ /* Body: */ await response . Content . ReadAsStringAsync ( Context . RequestAborted ) ) ;
138138
139139 throw new HttpRequestException ( "An error occurred while retrieving the email address associated to the user profile." ) ;
140140 }
141141
142- using var payload = JsonDocument . Parse ( await response . Content . ReadAsStringAsync ( ) ) ;
142+ using var payload = JsonDocument . Parse ( await response . Content . ReadAsStringAsync ( Context . RequestAborted ) ) ;
143143 return payload . RootElement . GetString ( "email" ) ;
144144 }
145145 }
0 commit comments