Skip to content

Commit

Permalink
Replace IdentityServer4 with Duende.IdentityServer (domaindrivendev#3008
Browse files Browse the repository at this point in the history
)
  • Loading branch information
pseudometalhead committed Dec 2, 2024
1 parent 6958989 commit 2551c56
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions test/WebSites/OAuth2Integration/AuthServer/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

namespace OAuth2Integration.AuthServer
{
internal static class Config
public static class Config
{
public static IEnumerable<Client> Clients()
internal static IEnumerable<Client> Clients()
{
yield return new Client
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public async Task<IActionResult> Login([FromForm] LoginViewModel viewModel)
return View("/AuthServer/Views/Login.cshtml", viewModel);
}

// Use an IdentityServer-compatible ClaimsPrincipal
var identityServerUser = new IdentityServerUser(viewModel.Username);
identityServerUser.DisplayName = viewModel.Username;

await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, identityServerUser.CreatePrincipal());

return Redirect(viewModel.ReturnUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,11 @@ namespace OAuth2Integration.AuthServer.Controllers
public class ConsentController : Controller
{
private readonly IIdentityServerInteractionService _interaction;
private readonly IClientStore _clientStore;
private readonly IResourceStore _resourceStore;

public ConsentController(
IIdentityServerInteractionService interaction,
IClientStore clientStore,
IResourceStore resourceStore)
IIdentityServerInteractionService interaction)
{
_interaction = interaction;
_clientStore = clientStore;
_resourceStore = resourceStore;
}

[HttpGet("consent")]
Expand Down
1 change: 1 addition & 0 deletions test/WebSites/OAuth2Integration/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public void ConfigureServices(IServiceCollection services)
{
c.SwaggerDoc("v1", new OpenApiInfo { Version = "v1", Title = "Test API V1" });

// Define the OAuth2.0 scheme that's in use (i.e. Implicit Flow)
c.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme
{
Type = SecuritySchemeType.OAuth2,
Expand Down

0 comments on commit 2551c56

Please sign in to comment.