-
Notifications
You must be signed in to change notification settings - Fork 8
/
Program.cs
38 lines (33 loc) · 1.04 KB
/
Program.cs
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
38
using Microsoft.AspNetCore.Identity;
using Zitadel.Authentication;
using Zitadel.Extensions;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRazorPages();
builder.Services
.AddAuthorization()
.AddAuthentication(ZitadelDefaults.AuthenticationScheme)
.AddZitadel(
o =>
{
o.Authority = "https://zitadel-libraries-l8boqa.zitadel.cloud/";
o.ClientId = "170088295403946241@library";
o.SignInScheme = IdentityConstants.ExternalScheme;
o.SaveTokens = true;
})
.AddExternalCookie()
.Configure(
o =>
{
o.Cookie.HttpOnly = true;
o.Cookie.IsEssential = true;
o.Cookie.SameSite = SameSiteMode.None;
o.Cookie.SecurePolicy = CookieSecurePolicy.Always;
});
var app = builder.Build();
app.UseDeveloperExceptionPage();
app.UseRouting();
app.UseHttpsRedirection();
app.UseAuthentication();
app.UseAuthorization();
app.MapRazorPages();
await app.RunAsync();