mirror of
https://github.com/microsoft/semantic-kernel.git
synced 2026-10-12 02:19:06 +00:00
### Motivation and Context The Semantic Kernel naming convention of Skills and Functions can cause confusion with the naming of the Azure Function sample project. ### Description 1. Updated sample `KernelHttpServer` project namespaces to match the project name. 1. Small adjustments to code style warnings (naming, unused namespaces, spacing).
26 lines
645 B
C#
26 lines
645 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using System.Net.Http;
|
|
using System.Net.Http.Headers;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.Graph;
|
|
|
|
namespace KernelHttpServer;
|
|
|
|
internal sealed class TokenAuthenticationProvider : IAuthenticationProvider
|
|
{
|
|
private readonly string _token;
|
|
|
|
public TokenAuthenticationProvider(string token)
|
|
{
|
|
this._token = token;
|
|
}
|
|
|
|
public Task AuthenticateRequestAsync(HttpRequestMessage request)
|
|
{
|
|
return Task.FromResult(request.Headers.Authorization = new AuthenticationHeaderValue(
|
|
scheme: "bearer",
|
|
parameter: this._token));
|
|
}
|
|
}
|