Closed skulidropek closed 1 year ago
Hi Skuli! Thanks for your interest in Ocelot!
"AddHeadersToRequest": {
"Authorization": "Bearer APIKEY"
},
Are you transforming headers extracting data from claims by this Ocelot feature: Claims to Headers Tranformation ??? Yes or NO?
We have another header-to-header transforms feature: Headers Transformation This feature just renames and forwards your headers.
From your description it is not clear which feature you are trying to use? It seems it is Claims to Headers transformation, but your configuration is incorrect, probably...
Hello, thanks for the answer. I'm trying to statically add a token in a file instead of "APITOKEN" like
"AddHeadersToRequest": {
"Authorization": "Bearer sk-....."
},
It seems you cannot use AddHeadersToRequest property because it is designed for dynamic claims data extraction. In that case Claims Transformation feature is not your option! You need to use the Headers Transformation to add a header to request statically!!!
Have I answered your question?
Thank you very much, everything works. For some reason, it was written everywhere that it was necessary to use AddHeadersToRequest and I spent 2 days tinkering with this problem. Thanks again
Hello everyone, can someone help me with this problem. I am trying to add my own header so that my client code does not require a token. But no matter how hard I try to do it, nothing comes out. I get an error message that the token is invalid because it does not transmit the header, but if I transmit the header with my token through the client using my API, then everything works