Browse Source

Add authentication to microservices web demo.

pull/216/head
Halil İbrahim Kalkan 9 years ago
parent
commit
4ed34f01a6
  1. 5220
      samples/MicroserviceDemo/MicroserviceDemo.Web/Logs/logs-20180226.txt
  2. 10
      samples/MicroserviceDemo/MicroserviceDemo.Web/MicroservicesDemoWebModule.cs
  3. 9
      samples/MicroserviceDemo/MicroserviceDemo.Web/Pages/Index.cshtml

5220
samples/MicroserviceDemo/MicroserviceDemo.Web/Logs/logs-20180226.txt

File diff suppressed because it is too large

10
samples/MicroserviceDemo/MicroserviceDemo.Web/MicroservicesDemoWebModule.cs

@ -55,6 +55,12 @@ namespace MicroserviceDemo.Web
context.DbContextOptions.UseSqlServer(context.ConnectionString);
}
});
//TODO: This should not be neededn when we fix the conn string name problem for interfaces
options.Configure<AbpPermissionsDbContext>(context =>
{
context.DbContextOptions.UseSqlServer(configuration.GetConnectionString("AbpPermissions"));
});
});
services.Configure<BundlingOptions>(options =>
@ -67,6 +73,8 @@ namespace MicroserviceDemo.Web
});
});
services.AddAuthentication();
services.AddAssemblyOf<MicroservicesDemoWebModule>();
}
@ -82,6 +90,8 @@ namespace MicroserviceDemo.Web
app.UseStaticFiles();
app.UseVirtualFiles();
app.UseAuthentication();
app.UseMvcWithDefaultRoute();
}

9
samples/MicroserviceDemo/MicroserviceDemo.Web/Pages/Index.cshtml

@ -5,6 +5,15 @@
<abp-card-header></abp-card-header>
<abp-card-body>
<a href="~/Account/Login">Login</a>
@if (User.Identity.IsAuthenticated)
{
foreach (var claim in User.Claims)
{
<div>@claim.Type = @claim.Value</div>
}
}
</abp-card-body>
</abp-card>
</p>
Loading…
Cancel
Save