Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions AuthorizationServer/AuthorizationServer.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<ReleaseVersion>1.0</ReleaseVersion>
</PropertyGroup>

Expand All @@ -17,13 +19,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.WebApiCompatShim" Version="2.0.1" />
<PackageReference Include="Authlete.Authlete" Version="1.4.0" />
</ItemGroup>

<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
<PackageReference Include="Authlete.Authlete" Version="1.5.0" />
</ItemGroup>

</Project>
16 changes: 13 additions & 3 deletions AuthorizationServer/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Authlete.Api;
using Authlete.Conf;

Expand All @@ -42,7 +43,7 @@ public void ConfigureServices(IServiceCollection services)
// AddWebApiConventions() is added by WebApiCompatShim.
// Calling the method enables Web API implementations
// to return an HttpResponseMessage instance directly.
services.AddMvc().AddWebApiConventions();
services.AddControllers();

// Register an instance of IAuthleteApi so controllers
// can refer to it in order to call Authlete Web APIs.
Expand All @@ -57,7 +58,7 @@ public void ConfigureServices(IServiceCollection services)
}


public void Configure(IApplicationBuilder app, IHostingEnvironment env)
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
Expand All @@ -66,7 +67,16 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)

app.UseDefaultFiles();
app.UseStaticFiles();
app.UseMvc();

// Updated to use routing
app.UseRouting();

// Configure endpoints for controllers
app.UseEndpoints(endpoints =>
{
// Ensure this matches your app's routing needs
endpoints.MapControllers();
});
}


Expand Down