Skip to content

Commit 36ac93e

Browse files
committed
Disabling hardcoded cookie auth (preparation to use more complicated authentication/authorization ways), make PageController route path to be fully configurable in order to serve IdentityManager2 from different configurable routes, library and deps bumps
1 parent deabfb8 commit 36ac93e

5 files changed

Lines changed: 573 additions & 713 deletions

File tree

src/IdentityManager2/Api/Controllers/PageController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
namespace IdentityManager2.Api.Controllers
1010
{
11+
[Route("idm")]
1112
[SecurityHeaders]
1213
[ResponseCache(NoStore = true, Location = ResponseCacheLocation.None)]
1314
public class PageController : Controller

src/IdentityManager2/Configuration/DependencyInjection/IdentityManagerServiceCollectionExtensions.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,20 @@ public static IIdentityManagerBuilder AddIdentityManager(this IServiceCollection
4545
options.AddPolicy(IdentityManagerConstants.IdMgrAuthPolicy, config =>
4646
{
4747
config.RequireClaim(identityManagerOptions.SecurityConfiguration.RoleClaimType, identityManagerOptions.SecurityConfiguration.AdminRoleName);
48-
config.AddAuthenticationSchemes(IdentityManagerConstants.LocalApiScheme);
48+
// config.AddAuthenticationSchemes(IdentityManagerConstants.LocalApiScheme);
4949
});
5050
});
5151

52-
services.AddAuthentication()
53-
.AddCookie(IdentityManagerConstants.LocalApiScheme, options =>
54-
{
55-
options.Cookie.SameSite = SameSiteMode.Strict;
56-
options.Cookie.HttpOnly = true;
57-
options.Cookie.IsEssential = true;
58-
options.Cookie.SecurePolicy = CookieSecurePolicy.SameAsRequest;
52+
// services.AddAuthentication()
53+
// .AddCookie(IdentityManagerConstants.LocalApiScheme, options =>
54+
// {
55+
// options.Cookie.SameSite = SameSiteMode.Strict;
56+
// options.Cookie.HttpOnly = true;
57+
// options.Cookie.IsEssential = true;
58+
// options.Cookie.SecurePolicy = CookieSecurePolicy.SameAsRequest;
5959

60-
options.LoginPath = "/api/login";
61-
});
60+
// options.LoginPath = "/api/login";
61+
// });
6262

6363
identityManagerOptions.SecurityConfiguration.Configure(services);
6464

src/IdentityManager2/IdentityManager2.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@
5050
</ItemGroup>
5151

5252
<ItemGroup>
53-
<PackageReference Include="AutoMapper" Version="7.0.1" />
54-
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
53+
<PackageReference Include="AutoMapper" Version="8.1.1" />
54+
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
5555
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
56-
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.0" />
57-
<PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.1.0" />
58-
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="2.1.0" />
59-
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.0" />
60-
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="2.1.0" />
56+
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
57+
<PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.2.0" />
58+
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="2.2.0" />
59+
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
60+
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="2.2.0" />
6161
</ItemGroup>
6262

6363
<ItemGroup>

0 commit comments

Comments
 (0)