Azure / azure-sdk-for-sap-odata

This repository serves as foundation to power SAP OData SDK development for .NET
MIT License
7 stars 3 forks source link

[FEATURE] Add API Key configuration option to SDK #21

Closed bdelangh closed 1 year ago

bdelangh commented 1 year ago

Is your feature request related to a problem? Please describe.

Since for changing, creating and deletion of an SAP Object, we'll be relying on an API mgmt policy for the xcsrf handling, I would be good if we have a way of proving the API Mgmt key to the c# Client

Describe the solution you'd like

Retrieve the API mgmt key from a configuration file or Azure Key vault

Describe alternatives you've considered

No response

Additional context

No response

WillEastbury commented 1 year ago

This could simply be added to the public options class BasicHttpAuthHandlerOptions.

This would enable us to load it using the existing config method and then add it to the request headers collection in the BuildHttpRequestMessageAsync method of the ODataHttpClientContext.

Line 105 of this class describes how we use the auth string / token, it would be VERY similar to this code if implemented.

WillEastbury commented 1 year ago

OK thankyou MartinPankraz