File tree Expand file tree Collapse file tree
Hosts.CookieAuthentication
Hosts.LosthostAuthentication Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
2- "iisSettings" : {
3- "windowsAuthentication" : false ,
4- "anonymousAuthentication" : true ,
5- "iisExpress" : {
6- "applicationUrl" : " http://localhost:60759" ,
7- "sslPort" : 0
8- }
9- },
102 "profiles" : {
11- "IIS Express" : {
12- "commandName" : " IISExpress" ,
13- "launchBrowser" : true ,
14- "environmentVariables" : {
15- "ASPNETCORE_ENVIRONMENT" : " Development"
16- }
17- },
18- "HostWithLocalAuth" : {
3+ "Hosts.CookieAuthentication" : {
194 "commandName" : " Project" ,
205 "launchBrowser" : true ,
216 "applicationUrl" : " http://localhost:5000" ,
Original file line number Diff line number Diff line change 11using System ;
22using Hosts . Shared . InMemory ;
3- using IdentityManager2 . Assets ;
43using Microsoft . AspNetCore . Builder ;
5- using Microsoft . AspNetCore . Http ;
64using Microsoft . Extensions . DependencyInjection ;
7- using Microsoft . Extensions . FileProviders ;
85
96namespace Hosts . CookieAuthentication
107{
@@ -42,15 +39,10 @@ public void Configure(IApplicationBuilder app)
4239 app . UseAuthentication ( ) ;
4340 app . UseAuthorization ( ) ;
4441
45- app . UseFileServer ( new FileServerOptions
46- {
47- RequestPath = new PathString ( "/assets" ) ,
48- FileProvider = new EmbeddedFileProvider ( typeof ( EmbeddedHtmlResult ) . Assembly , "IdentityManager2.Assets" )
49- } ) ;
42+ app . UseIdentityManager ( ) ;
5043
5144 app . UseEndpoints ( x =>
5245 {
53- //x.MapIdentityManager("/idm");
5446 x . MapDefaultControllerRoute ( ) ;
5547 } ) ;
5648 }
Original file line number Diff line number Diff line change 11{
22 "profiles" : {
3- "Host " : {
3+ "Hosts.LosthostAuthentication " : {
44 "commandName" : " Project" ,
5- /*"launchBrowser": true,*/
5+ "launchBrowser" : true ,
6+ "applicationUrl" : " http://localhost:5000" ,
67 "environmentVariables" : {
78 "ASPNETCORE_ENVIRONMENT" : " Development"
8- },
9- "applicationUrl" : " http://localhost:5000/"
9+ }
1010 }
1111 }
1212}
Original file line number Diff line number Diff line change 22using Microsoft . Extensions . DependencyInjection ;
33using System ;
44using Hosts . Shared . InMemory ;
5- using IdentityManager2 . Assets ;
6- using Microsoft . AspNetCore . Http ;
7- using Microsoft . Extensions . FileProviders ;
85
96namespace Hosts . LosthostAuthentication
107{
@@ -32,15 +29,10 @@ public void Configure(IApplicationBuilder app)
3229 app . UseAuthentication ( ) ;
3330 app . UseAuthorization ( ) ;
3431
35- app . UseFileServer ( new FileServerOptions
36- {
37- RequestPath = new PathString ( "/assets" ) ,
38- FileProvider = new EmbeddedFileProvider ( typeof ( EmbeddedHtmlResult ) . Assembly , "IdentityManager2.Assets" )
39- } ) ;
32+ app . UseIdentityManager ( ) ;
4033
4134 app . UseEndpoints ( x =>
4235 {
43- //x.MapIdentityManager("/idm");
4436 x . MapDefaultControllerRoute ( ) ;
4537 } ) ;
4638 }
Original file line number Diff line number Diff line change 77
88namespace IdentityManager2 . Assets
99{
10- // TODO: internal
11- public class EmbeddedHtmlResult : IActionResult
10+ internal class EmbeddedHtmlResult : IActionResult
1211 {
1312 private readonly string path ;
1413 private readonly string file ;
Original file line number Diff line number Diff line change 1+ using IdentityManager2 . Assets ;
2+ using Microsoft . AspNetCore . Http ;
3+ using Microsoft . Extensions . FileProviders ;
4+
5+ namespace Microsoft . AspNetCore . Builder
6+ {
7+ public static class IdentityManagerApplicationBuilderExtensions
8+ {
9+ public static IApplicationBuilder UseIdentityManager ( this IApplicationBuilder app )
10+ {
11+ app . UseFileServer ( new FileServerOptions
12+ {
13+ RequestPath = new PathString ( "/assets" ) ,
14+ FileProvider = new EmbeddedFileProvider ( typeof ( EmbeddedHtmlResult ) . Assembly , "IdentityManager2.Assets" )
15+ } ) ;
16+
17+ return app ;
18+ }
19+ }
20+ }
Original file line number Diff line number Diff line change 6666 </EmbeddedResource >
6767 </ItemGroup >
6868
69- <ItemGroup >
70- <Folder Include =" Configuration\Hosting\" />
71- </ItemGroup >
72-
7369</Project >
You can’t perform that action at this time.
0 commit comments