.Net: Add support for custom authentication provider for OpenAPI by mojanas · Pull Request #2283 · microsoft/semantic-kernel

@mojanas

@shawncal added .NET

Issue or Pull requests regarding .NET code

kernel

Issues or pull requests impacting the core kernel

labels

Aug 2, 2023

@shawncal shawncal changed the title Add support for custom authentication provider for OpenAPI .Net: Add support for custom authentication provider for OpenAPI

Aug 2, 2023

@mojanas

@mojanas mojanas marked this pull request as ready for review

August 2, 2023 15:45

@glahaye

SergeyMenshykh

rogerbarreto

shawncal

@mojanas mojanas deleted the openapi/custom-auth branch

August 18, 2023 15:09

SOE-YoungS pushed a commit to SOE-YoungS/semantic-kernel that referenced this pull request

Nov 1, 2023
…rosoft#2283)

### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

1. **Why is this change required?** This change adds support for other
authentication methods defined in OpenAPI specs.
2. **What problem does it solve?** Some APIs use other authentication
methods that define a value in a custom header. As an example, [many
PlayFab
APIs](https://learn.microsoft.com/en-us/gaming/playfab/api-references/#security)
are authenticated using secret key or user token in a custom header. The
current authentication providers are not sufficient for onboarding these
APIs as skills.
3. **What scenario does it contribute to?** This change will enable APIs
using custom header authentication to onboard their OpenAPI specs as
skills in Semantic Kernel.
  4. **If it fixes an open issue, please link to the issue here.**

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

This change adds a new OpenAPI authentication provider that enables
specifying a custom header to supply the authentication key or value.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄

---------

Co-authored-by: Gil LaHaye <gillahaye@microsoft.com>
Co-authored-by: Shawn Callegari <36091529+shawncal@users.noreply.github.com>