initial commit

This commit is contained in:
2024-12-20 01:50:06 -05:00
commit 918faa1937
18 changed files with 890 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
using OpenHarbor.JwtTokenManager;
using OpenHarbor.JwtTokenManager.Abstractions;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddHttpClient();
builder.Services.AddMemoryCache();
builder.Services.AddJwtTokenManager(builder.Configuration, "JwtTokenManager", options =>
{
options.Cache(cacheOptions =>
{
cacheOptions.ExpirationOffset = 30;
});
});
var app = builder.Build();
app.UseHttpsRedirection();
app.MapGet("/", async (IJwtTokenManagerService jwtTokenManagerService, CancellationToken cancellationToken) =>
{
var response = await jwtTokenManagerService.GetTokenAsync(cancellationToken);
return Results.Ok(response);
});;
app.Run();
+25
View File
@@ -0,0 +1,25 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"launchUrl": "",
"applicationUrl": "http://localhost:5050",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"launchUrl": "",
"applicationUrl": "https://localhost:7204;http://localhost:5050",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
+18
View File
@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\OpenHarbor.JwtTokenManager\OpenHarbor.JwtTokenManager.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.1" />
</ItemGroup>
</Project>
+15
View File
@@ -0,0 +1,15 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"JwtTokenManager": {
"TokenEndpoint": "",
"ClientId": "",
"ClientSecret": "",
"Scopes": []
}
}