microsoft / autogen

A programming framework for agentic AI. Discord: https://aka.ms/autogen-dc. Roadmap: https://aka.ms/autogen-roadmap
https://microsoft.github.io/autogen/
Creative Commons Attribution 4.0 International
28.16k stars 4.11k forks source link

[Feature Request]: support more advanced authentication mechanisms than api keys #2839

Open eyal-lantzman opened 1 month ago

eyal-lantzman commented 1 month ago

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

Adoption in secure environments configured with OIDC based auth needs some level of extensibility to be built e.g. support requests.auth.AuthBase Implementations (custom or from https://requests.readthedocs.io/en/latest/user/authentication/)

Describe the solution you'd like

Refactor auto code to use Auth add and support extension point to provide custom ones in addition to apikey based default implementation to be backward compatible

Additional context

I’m happy to provide that implementation

luxzoli commented 1 month ago

Would you like to do this for service principals, or personal accounts? In my opinion both can be very useful. Azure OpenAI actually already has very good libraries and examples for this 🙂

Actually, if the necessary environment variables are set, then the DefaultAzureCredential will also work with service principals. See example in the official docs here

PS: this example is of course only for OpenAI