-
Notifications
You must be signed in to change notification settings - Fork 275
Expand file tree
/
Copy pathProgram.cs
More file actions
37 lines (23 loc) · 1.04 KB
/
Program.cs
File metadata and controls
37 lines (23 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (c) Duende Software. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using IdentityServerHost;
using Microsoft.AspNetCore.DataProtection;
Console.Title = "IdentityServer";
var builder = WebApplication.CreateBuilder(args);
builder.AddServiceDefaults();
var idsvrBuilder = builder.Services.AddIdentityServer()
.AddInMemoryApiScopes(Config.Scopes)
.AddInMemoryClients(Config.Clients);
// registers extension grant validator for the token exchange grant type
idsvrBuilder.AddExtensionGrantValidator<TokenExchangeGrantValidator>();
// register a profile service to emit the act claim
idsvrBuilder.AddProfileService<ProfileService>();
// Add `.PersistKeysTo…()` and `.ProtectKeysWith…()` calls
// See more at https://docs.duendesoftware.com/general/data-protection
builder.Services.AddDataProtection()
.SetApplicationName("IdentityServer");
var app = builder.Build();
app.MapDefaultEndpoints();
app.UseDeveloperExceptionPage();
app.UseIdentityServer();
app.Run();