-
-
Notifications
You must be signed in to change notification settings - Fork 747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] AddRefitClient doesn't use the AuthorizationHeaderValueGetter #689
Comments
Might be similar like #574 , because of the HttpClientFactory. To be determined though. |
After some debugging it looks like the AddRefitClient path completely ignores the Handler selection |
@onovotny @Elfocrash Any progress here? |
I had to do some DI hack locally to get this to work on my project but no actual fix yet. Both AuthorizationHeaderValueGetter and the other requestMessage one are not working. |
@onovotny Could you please have a look into this? Refit should be able to override this HttpClientFactory settings especially for authorization. |
PR's with related unit tests are welcome! I've been busy and haven't had time to look into this. |
Fixed by #861 |
Describe the bug
If I use the AddRefitClient to register my client then the AuthorizationHeaderValueGetter isn't used.
I have the following interface and the following settings:
If i call
RestService.For<ISomeApi>("https://api.test.com", refitSettings)
then my call is properly populated with theAuthorization
header having a valueBearer AuthKey
.However if I use the same
ISomeApi
interface using theAddRefitClient
like thisservices.AddRefitClient<ISomeApi>(refitSettings);
then the Authorization header's value isBearer
. The getter is never invoked to set the value.Expected behavior
Both
RestService.For
andAddRefitClient
should be utilizing the settings in the same way and the header should be populated.Environment
The text was updated successfully, but these errors were encountered: