YureshTharushika
Authentication problem in SignalR
this is program.cs file:
https://paste.mod.gg/lkqeymkcboms/0
7 replies
✅ SignalR authentication not working
// Add Authentication
builder.Services.AddAuthentication().AddBearerToken(IdentityConstants.BearerScheme);
builder.Services.AddAuthorizationBuilder();
builder.Services.AddIdentityCore<User>()
.AddEntityFrameworkStores<Context>()
.AddApiEndpoints();
var app = builder.Build();
app.UseCors();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseAuthentication();
app.UseAuthorization();
app.MapIdentityApi<User>();
app.MapControllers();
app.MapHub<ChatHub>("/chathub");
app.Run();
7 replies