Sometimes you cannot set an authorization header with a scheme. This also applies to the project I'm currently working on. I need to connect to the API from TOPdesk , but no schema is specified.
The authorization header from TOPdesk should have a value similar to TOKEN id="0d1739df-8952-41c0-94cd-b25287446b22" so I can not use the scheme. I solved the problem by adding an authorization header, as in the following example, and it works like a charm.
client.DefaultRequestHeaders.Add("Authorization", $"TOKEN id=\"{token}\"");
I know this is an old question, but I thought that maybe someone in the future would look at this answer and find it useful. I came across this question in exactly the same way.
source share