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
|
||||
{
|
||||
[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<OrderSummary>), (int)HttpStatusCode.OK)]
|
||||
public async Task<ActionResult<IEnumerable<OrderSummary>>> 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);
|
||||
}
|
||||
|
@ -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<string>("IdentityUrlExternal")}/connect/authorize"),
|
||||
TokenUrl = new Uri($"{configuration.GetValue<string>("IdentityUrlExternal")}/connect/token"),
|
||||
Scopes = new Dictionary<string, string>()
|
||||
{
|
||||
{ "orders", "Ordering API" }
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
// options.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme
|
||||
// {
|
||||
// Type = SecuritySchemeType.OAuth2,
|
||||
// Flows = new OpenApiOAuthFlows()
|
||||
// {
|
||||
// Implicit = new OpenApiOAuthFlow()
|
||||
// {
|
||||
// AuthorizationUrl = new Uri($"{configuration.GetValue<string>("IdentityUrlExternal")}/connect/authorize"),
|
||||
// TokenUrl = new Uri($"{configuration.GetValue<string>("IdentityUrlExternal")}/connect/token"),
|
||||
// Scopes = new Dictionary<string, string>()
|
||||
// {
|
||||
// { "orders", "Ordering API" }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
options.OperationFilter<AuthorizeCheckOperationFilter>();
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user