Removed auth
This commit is contained in:
parent
4297b2efe0
commit
9a8527b141
@ -15,7 +15,7 @@ using System.Threading.Tasks;
|
|||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers
|
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers
|
||||||
{
|
{
|
||||||
[Route("api/v1/[controller]")]
|
[Route("api/v1/[controller]")]
|
||||||
[Authorize]
|
//[Authorize]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class OrdersController : ControllerBase
|
public class OrdersController : ControllerBase
|
||||||
{
|
{
|
||||||
@ -120,8 +120,8 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers
|
|||||||
[ProducesResponseType(typeof(IEnumerable<OrderSummary>), (int)HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(IEnumerable<OrderSummary>), (int)HttpStatusCode.OK)]
|
||||||
public async Task<ActionResult<IEnumerable<OrderSummary>>> GetOrdersAsync()
|
public async Task<ActionResult<IEnumerable<OrderSummary>>> GetOrdersAsync()
|
||||||
{
|
{
|
||||||
var userid = _identityService.GetUserIdentity();
|
var userId = _identityService.GetUserIdentity();
|
||||||
var orders = await _orderQueries.GetOrdersFromUserAsync(Guid.Parse(userid));
|
var orders = await _orderQueries.GetOrdersFromUserAsync(Guid.Parse(userId));
|
||||||
|
|
||||||
return Ok(orders);
|
return Ok(orders);
|
||||||
}
|
}
|
||||||
|
@ -62,8 +62,8 @@
|
|||||||
.AddCustomSwagger(Configuration)
|
.AddCustomSwagger(Configuration)
|
||||||
.AddCustomIntegrations(Configuration)
|
.AddCustomIntegrations(Configuration)
|
||||||
.AddCustomConfiguration(Configuration)
|
.AddCustomConfiguration(Configuration)
|
||||||
.AddEventBus(Configuration)
|
.AddEventBus(Configuration);
|
||||||
.AddCustomAuthentication(Configuration);
|
|
||||||
//configure autofac
|
//configure autofac
|
||||||
|
|
||||||
var container = new ContainerBuilder();
|
var container = new ContainerBuilder();
|
||||||
@ -148,8 +148,8 @@
|
|||||||
|
|
||||||
protected virtual void ConfigureAuth(IApplicationBuilder app)
|
protected virtual void ConfigureAuth(IApplicationBuilder app)
|
||||||
{
|
{
|
||||||
app.UseAuthentication();
|
// app.UseAuthentication();
|
||||||
app.UseAuthorization();
|
// app.UseAuthorization();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,22 +260,22 @@
|
|||||||
Version = "v1",
|
Version = "v1",
|
||||||
Description = "The Ordering Service HTTP API"
|
Description = "The Ordering Service HTTP API"
|
||||||
});
|
});
|
||||||
options.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme
|
// options.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme
|
||||||
{
|
// {
|
||||||
Type = SecuritySchemeType.OAuth2,
|
// Type = SecuritySchemeType.OAuth2,
|
||||||
Flows = new OpenApiOAuthFlows()
|
// Flows = new OpenApiOAuthFlows()
|
||||||
{
|
// {
|
||||||
Implicit = new OpenApiOAuthFlow()
|
// Implicit = new OpenApiOAuthFlow()
|
||||||
{
|
// {
|
||||||
AuthorizationUrl = new Uri($"{configuration.GetValue<string>("IdentityUrlExternal")}/connect/authorize"),
|
// AuthorizationUrl = new Uri($"{configuration.GetValue<string>("IdentityUrlExternal")}/connect/authorize"),
|
||||||
TokenUrl = new Uri($"{configuration.GetValue<string>("IdentityUrlExternal")}/connect/token"),
|
// TokenUrl = new Uri($"{configuration.GetValue<string>("IdentityUrlExternal")}/connect/token"),
|
||||||
Scopes = new Dictionary<string, string>()
|
// Scopes = new Dictionary<string, string>()
|
||||||
{
|
// {
|
||||||
{ "orders", "Ordering API" }
|
// { "orders", "Ordering API" }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
options.OperationFilter<AuthorizeCheckOperationFilter>();
|
options.OperationFilter<AuthorizeCheckOperationFilter>();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user