@@ -65,12 +65,12 @@ protected override async Task<OAuthTokenResponse> ExchangeCodeAsync([NotNull] OA
65
65
"returned a {Status} response with the following payload: {Headers} {Body}." ,
66
66
/* Status: */ response . StatusCode ,
67
67
/* Headers: */ response . Headers . ToString ( ) ,
68
- /* Body: */ await response . Content . ReadAsStringAsync ( ) ) ;
68
+ /* Body: */ await response . Content . ReadAsStringAsync ( Context . RequestAborted ) ) ;
69
69
70
70
return OAuthTokenResponse . Failed ( new Exception ( "An error occurred while retrieving an access token." ) ) ;
71
71
}
72
72
73
- var payload = JsonDocument . Parse ( await response . Content . ReadAsStringAsync ( ) ) ;
73
+ var payload = JsonDocument . Parse ( await response . Content . ReadAsStringAsync ( Context . RequestAborted ) ) ;
74
74
return OAuthTokenResponse . Success ( payload ) ;
75
75
}
76
76
@@ -90,12 +90,12 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
90
90
"returned a {Status} response with the following payload: {Headers} {Body}." ,
91
91
/* Status: */ response . StatusCode ,
92
92
/* Headers: */ response . Headers . ToString ( ) ,
93
- /* Body: */ await response . Content . ReadAsStringAsync ( ) ) ;
93
+ /* Body: */ await response . Content . ReadAsStringAsync ( Context . RequestAborted ) ) ;
94
94
95
95
throw new HttpRequestException ( "An error occurred while retrieving user information." ) ;
96
96
}
97
97
98
- using var payload = JsonDocument . Parse ( await response . Content . ReadAsStringAsync ( ) ) ;
98
+ using var payload = JsonDocument . Parse ( await response . Content . ReadAsStringAsync ( Context . RequestAborted ) ) ;
99
99
var principal = new ClaimsPrincipal ( identity ) ;
100
100
var context = new OAuthCreatingTicketContext ( principal , properties , Context , Scheme , Options , Backchannel , tokens , payload . RootElement ) ;
101
101
context . RunClaimActions ( ) ;
@@ -134,12 +134,12 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
134
134
"the remote server returned a {Status} response with the following payload: {Headers} {Body}." ,
135
135
/* Status: */ response . StatusCode ,
136
136
/* Headers: */ response . Headers . ToString ( ) ,
137
- /* Body: */ await response . Content . ReadAsStringAsync ( ) ) ;
137
+ /* Body: */ await response . Content . ReadAsStringAsync ( Context . RequestAborted ) ) ;
138
138
139
139
throw new HttpRequestException ( "An error occurred while retrieving the email address associated to the user profile." ) ;
140
140
}
141
141
142
- using var payload = JsonDocument . Parse ( await response . Content . ReadAsStringAsync ( ) ) ;
142
+ using var payload = JsonDocument . Parse ( await response . Content . ReadAsStringAsync ( Context . RequestAborted ) ) ;
143
143
return payload . RootElement . GetString ( "email" ) ;
144
144
}
145
145
}
0 commit comments