From 9a8527b141890b3a76c19bcaa8ca1415ae79bd14 Mon Sep 17 00:00:00 2001 From: Calle Veale Date: Sun, 30 May 2021 06:29:55 +0200 Subject: [PATCH] Removed auth --- .../Controllers/OrdersController.cs | 6 +-- src/Services/Ordering/Ordering.API/Startup.cs | 40 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs b/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs index e31568d98..478afa813 100644 --- a/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs +++ b/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs @@ -15,7 +15,7 @@ using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers { [Route("api/v1/[controller]")] - [Authorize] + //[Authorize] [ApiController] public class OrdersController : ControllerBase { @@ -120,8 +120,8 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers [ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)] public async Task>> GetOrdersAsync() { - var userid = _identityService.GetUserIdentity(); - var orders = await _orderQueries.GetOrdersFromUserAsync(Guid.Parse(userid)); + var userId = _identityService.GetUserIdentity(); + var orders = await _orderQueries.GetOrdersFromUserAsync(Guid.Parse(userId)); return Ok(orders); } diff --git a/src/Services/Ordering/Ordering.API/Startup.cs b/src/Services/Ordering/Ordering.API/Startup.cs index 5813a0578..848a5e509 100644 --- a/src/Services/Ordering/Ordering.API/Startup.cs +++ b/src/Services/Ordering/Ordering.API/Startup.cs @@ -62,8 +62,8 @@ .AddCustomSwagger(Configuration) .AddCustomIntegrations(Configuration) .AddCustomConfiguration(Configuration) - .AddEventBus(Configuration) - .AddCustomAuthentication(Configuration); + .AddEventBus(Configuration); + //configure autofac var container = new ContainerBuilder(); @@ -148,8 +148,8 @@ protected virtual void ConfigureAuth(IApplicationBuilder app) { - app.UseAuthentication(); - app.UseAuthorization(); + // app.UseAuthentication(); + // app.UseAuthorization(); } } @@ -260,22 +260,22 @@ Version = "v1", Description = "The Ordering Service HTTP API" }); - options.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme - { - Type = SecuritySchemeType.OAuth2, - Flows = new OpenApiOAuthFlows() - { - Implicit = new OpenApiOAuthFlow() - { - AuthorizationUrl = new Uri($"{configuration.GetValue("IdentityUrlExternal")}/connect/authorize"), - TokenUrl = new Uri($"{configuration.GetValue("IdentityUrlExternal")}/connect/token"), - Scopes = new Dictionary() - { - { "orders", "Ordering API" } - } - } - } - }); + // options.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme + // { + // Type = SecuritySchemeType.OAuth2, + // Flows = new OpenApiOAuthFlows() + // { + // Implicit = new OpenApiOAuthFlow() + // { + // AuthorizationUrl = new Uri($"{configuration.GetValue("IdentityUrlExternal")}/connect/authorize"), + // TokenUrl = new Uri($"{configuration.GetValue("IdentityUrlExternal")}/connect/token"), + // Scopes = new Dictionary() + // { + // { "orders", "Ordering API" } + // } + // } + // } + // }); options.OperationFilter(); });