Updating RMS

This commit is contained in:
Zeeshaun
2026-03-23 19:23:05 +00:00
parent 71b614ec92
commit 69648a3b8f
6 changed files with 55 additions and 11 deletions
@@ -3,7 +3,10 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Identity.Web;
using Microsoft.Identity.Web.UI;
using Blazored.Toast;
using LCU.Library.Internal.Configuration;
using LCU.Library.Internal.LcuHttpClient;
using ReserveManagementSystemUI.Service;
using ReserveManagementSystemUI.Services;
@@ -12,6 +15,7 @@ using Blazored.Modal;
using ReserveManagementSystemUI.Model.Configuration;
using LCU.Library.Internal.Logging;
using LCU.Library.Internal.Logging.Models;
using LCU.Library.Internal.Security;
namespace ReserveManagementSystemUI
{
@@ -28,6 +32,9 @@ namespace ReserveManagementSystemUI
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
services.AddAzureAdGroupPolicyServicesWithToken(Configuration.GetSection("AzureAd"),
Configuration.GetSection("Security"));
var appConfiguration = new AppConfiguration();
Configuration.GetSection("Primary").Bind(appConfiguration);
@@ -38,7 +45,8 @@ namespace ReserveManagementSystemUI
lcuLogging.UseLcuLogging();
services.AddRazorPages();
services.AddServerSideBlazor();
services.AddControllersWithViews().AddMicrosoftIdentityUI();
services.AddServerSideBlazor().AddMicrosoftIdentityConsentHandler();
LcuConfigureServicesAddons(services);
}
@@ -52,11 +60,6 @@ namespace ReserveManagementSystemUI
services.AddSingleton(rmsUIConfiguration);
services.AddSingleton<IConfiguration>(Configuration);
services.AddAuthentication();
services.AddAuthorization(config =>
{
config.AddPolicy("IsRMSAssociate", policy => policy.RequireRole(rmsUIConfiguration.RmsAssociatesRoles.Split(',')));
});
services.AddLCUHttpServices();
services.AddHttpContextAccessor();
@@ -91,9 +94,13 @@ namespace ReserveManagementSystemUI
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
endpoints.MapRazorPages();
endpoints.MapBlazorHub();
endpoints.MapFallbackToPage("/_Host");
});