tseisel
08/12/2019, 7:38 AMHttpClient
feature for handling OAuth authentication. Here is how it should operate :
1. On each request, if a valid auth token is available, then perform the request by adding the Authorization: Bearer <token>
2. If no token is available or the token expired, then perform a request on a configurable authentication endpoint with provided credentials. If authentication succeeds, save the received token and perform the initial request with the Authorization
header.
I've seen that this kind of features can be implemented using HttpClient
pipelines, but can't find how to use them with my use case. What pipeline/phase should I use ? How to perform the authentication request with the same config (for example JSON deserialization) as the initial request ?e5l
08/12/2019, 7:40 AMtseisel
08/12/2019, 8:58 AMBefore
in the request pipeline and use the HttpSend
feature to send the authentication request, then apply the headers by intercepting State
?e5l
08/12/2019, 8:59 AM