Код: Выделить всё
//... other code removed for brevity
builder.Services.AddAuthentication.AddOpenIdConnect(
OpenIdConnectDefaults.AuthenticationScheme,
opts =>
{
opts.Authority = builder.Configuration["Authority"];
opts.ClientId = builder.Configuration["ClientId"];
opts.ClientSecret = builder.Configuration["ClientSecret"];
opts.CallbackPath = "/signin-oidc";
opts.ResponseType = "code";
opts.UsePkce = true;
if (builder.Environment.IsDevelopment())
{
opts.RequireHttpsMetadata = false;
}
opts.GetClaimsFromUserInfoEndpoint = true;
opts.ClaimActions.MapAll();
});
Код: Выделить всё
app.Use(
async (context, next) =>
{
if (!context.Request.Cookies.ContainsKey(AuthConstants.CookieSessionKey))
{
await context.ChallengeAsync(OpenIdConnectDefaults.AuthenticationScheme);
}
else
{
await next.Invoke(context);
}
});
Код: Выделить всё
this.http.get("https://localhost:7030/.well-known/bff-getsessioninfo")
.subscribe(resp => {
console.log(resp);
})
Синтаксическая ошибка: неожиданный токен '
Подробнее здесь: https://stackoverflow.com/questions/788 ... r-frontend