microsoft / kiota-dotnet

Abstractions library for the Kiota generated SDKs in dotnet
https://aka.ms/kiota/docs
MIT License
39 stars 34 forks source link

Add support for Basic Authentication #472

Open thompson-tomo opened 2 days ago

thompson-tomo commented 2 days ago

The API which i am using Kiota to generate a client for uses Basic auth however there is no included provider to implement basic auth, which is a common and wide spread provider.

As such it would be useful if this was provided as part of the base package.

baywet commented 2 days ago

Hi @thompson-tomo Thank you for using kiota and for reaching out.

Kiota technically already supports it through the ApiKeyAuthenticationProvider

Setting an API key of "Basic base64(username:password)", parameter name of "Authorization" and location of Header would do the trick.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization#examples

Of course, we could always provide a derived class that does the setup for the developer to make it easier and more obvious.

Is this something you'd like to submit a pull request for provided some guidance?

thompson-tomo commented 1 day ago

Sure I will put a pr through.