Loading src/api/Cals.Visor.Api.xml +1 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ </member> <member name="T:Cals.Visor.Identity.VisorUser"> <summary> <see cref="T:Cals.Authentication.IApplicationUser"/> for the Directory Edit app. <see cref="T:Cals.Authentication.IWiscEduUser"/> for VISOR app. </summary> </member> <member name="T:Cals.Web.ErrorHandling.EndpointExtractor"> Loading src/api/Controllers/SessionController.cs 0 → 100644 +20 −0 Original line number Diff line number Diff line using Cals.Visor.Identity; using Microsoft.AspNetCore.Mvc; namespace Cals.Visor.Api.Controllers; [Route("[controller]")] [ApiController] public class SessionController : ControllerBase { [ProducesResponseType(typeof(SessionInfo), StatusCodes.Status200OK)] [HttpGet("~/session_info", Name = "GetSessionInfo")] public IActionResult GetUserInfo() { var sessionInfo = new SessionInfo() { User = new VisorUser(HttpContext.User) }; return Ok(sessionInfo); } } src/api/Identity/SessionInfo.cs 0 → 100644 +8 −0 Original line number Diff line number Diff line using Cals.Visor.Identity; namespace Cals.Visor.Api; public class SessionInfo { public VisorUser? User { get; set; } } src/api/Identity/VisorUser.cs +2 −2 Original line number Diff line number Diff line Loading @@ -4,9 +4,9 @@ using Cals.Authentication; namespace Cals.Visor.Identity; /// <summary> /// <see cref="IApplicationUser"/> for the Directory Edit app. /// <see cref="IWiscEduUser"/> for VISOR app. /// </summary> public class VisorUser : ClaimsApplicationUser, IApplicationUser public class VisorUser : WiscEduOidcUser, IWiscEduUser { public const string VisorAuthenticationType = "Visor"; Loading src/api/Program.cs +2 −13 Original line number Diff line number Diff line Loading @@ -139,17 +139,6 @@ builder.Services await Task.CompletedTask; } }; //options.Events = new JwtBearerEvents //{ // OnTokenValidated = context => // { // ClaimsIdentity identity = (ClaimsIdentity)context.Principal!.Identity!; // var token = context.SecurityToken.RawData; // identity.AddClaim(new Claim("access_token", token)); // return Task.CompletedTask; // } //} }); // Enable lowercase routes for controllers Loading Loading @@ -272,7 +261,7 @@ ServiceActivator.Configure(app.Services); app.Run(); // Configures the Azure Key Vault for this app void ConfigureAzureKeyVault(WebApplicationBuilder builder) static void ConfigureAzureKeyVault(WebApplicationBuilder builder) { if (!builder.Environment.IsDevelopment()) { Loading Loading @@ -308,7 +297,7 @@ void ConfigureAzureKeyVault(WebApplicationBuilder builder) } // Add the background service platform Quartz for internal commands and outbox void ConfigureQuartz(IServiceCollection services) static void ConfigureQuartz(IServiceCollection services) { services.AddQuartz(q => { Loading Loading
src/api/Cals.Visor.Api.xml +1 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ </member> <member name="T:Cals.Visor.Identity.VisorUser"> <summary> <see cref="T:Cals.Authentication.IApplicationUser"/> for the Directory Edit app. <see cref="T:Cals.Authentication.IWiscEduUser"/> for VISOR app. </summary> </member> <member name="T:Cals.Web.ErrorHandling.EndpointExtractor"> Loading
src/api/Controllers/SessionController.cs 0 → 100644 +20 −0 Original line number Diff line number Diff line using Cals.Visor.Identity; using Microsoft.AspNetCore.Mvc; namespace Cals.Visor.Api.Controllers; [Route("[controller]")] [ApiController] public class SessionController : ControllerBase { [ProducesResponseType(typeof(SessionInfo), StatusCodes.Status200OK)] [HttpGet("~/session_info", Name = "GetSessionInfo")] public IActionResult GetUserInfo() { var sessionInfo = new SessionInfo() { User = new VisorUser(HttpContext.User) }; return Ok(sessionInfo); } }
src/api/Identity/SessionInfo.cs 0 → 100644 +8 −0 Original line number Diff line number Diff line using Cals.Visor.Identity; namespace Cals.Visor.Api; public class SessionInfo { public VisorUser? User { get; set; } }
src/api/Identity/VisorUser.cs +2 −2 Original line number Diff line number Diff line Loading @@ -4,9 +4,9 @@ using Cals.Authentication; namespace Cals.Visor.Identity; /// <summary> /// <see cref="IApplicationUser"/> for the Directory Edit app. /// <see cref="IWiscEduUser"/> for VISOR app. /// </summary> public class VisorUser : ClaimsApplicationUser, IApplicationUser public class VisorUser : WiscEduOidcUser, IWiscEduUser { public const string VisorAuthenticationType = "Visor"; Loading
src/api/Program.cs +2 −13 Original line number Diff line number Diff line Loading @@ -139,17 +139,6 @@ builder.Services await Task.CompletedTask; } }; //options.Events = new JwtBearerEvents //{ // OnTokenValidated = context => // { // ClaimsIdentity identity = (ClaimsIdentity)context.Principal!.Identity!; // var token = context.SecurityToken.RawData; // identity.AddClaim(new Claim("access_token", token)); // return Task.CompletedTask; // } //} }); // Enable lowercase routes for controllers Loading Loading @@ -272,7 +261,7 @@ ServiceActivator.Configure(app.Services); app.Run(); // Configures the Azure Key Vault for this app void ConfigureAzureKeyVault(WebApplicationBuilder builder) static void ConfigureAzureKeyVault(WebApplicationBuilder builder) { if (!builder.Environment.IsDevelopment()) { Loading Loading @@ -308,7 +297,7 @@ void ConfigureAzureKeyVault(WebApplicationBuilder builder) } // Add the background service platform Quartz for internal commands and outbox void ConfigureQuartz(IServiceCollection services) static void ConfigureQuartz(IServiceCollection services) { services.AddQuartz(q => { Loading