{"id":444654,"date":"2025-01-10T21:01:04","date_gmt":"2025-01-10T21:01:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=444654"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=444654","title":{"rendered":"<span>\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0432 ASP.NET: \u041e\u043f\u044b\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u043d\u0430\u0437\u0430\u0434 \u044f \u043d\u0430\u0447\u0430\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0431\u044d\u043a\u044d\u043d\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 ASP.NET API. \u041f\u0440\u043e\u0435\u043a\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u043b \u0441\u043e\u0431\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u0431\u0440\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0442\u0435\u043b\u0435\u0439 (Airbnb \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u043b \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0440\u0435\u0444\u0435\u0440\u0435\u043d\u0441\u043e\u043c). \u041e\u043f\u044b\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 ASP.NET \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u043b\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e: \u043c\u043d\u043e\u0433\u043e\u043c\u0443 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0431\u0443\u0447\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435, \u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u043e \u0447\u0430\u0441\u044b, \u0430 \u0442\u043e \u0438 \u0434\u043d\u0438.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0434\u0435\u043b\u044e\u0441\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u0438 \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c\u0438 \u0438 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u0435 \u0441\u0430\u043c\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435<\/p>\n<h2>\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c: \u0440\u0430\u0437\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 <\/h2>\n<p> \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0438\u043f\u043e\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u0432\u043e\u044e \u0440\u043e\u043b\u044c:<\/p>\n<ul>\n<li>\n<p><strong>Tourist<\/strong> \u2013 \u0442\u0443\u0440\u0438\u0441\u0442\u044b, \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0449\u0443\u0442 \u0436\u0438\u043b\u044c\u0451 \u0434\u043b\u044f \u0431\u0440\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u0431\u0440\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u043c\u0435\u0440\u0430 \u0438 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u0442\u0437\u044b\u0432\u044b.<\/p>\n<\/li>\n<li>\n<p><strong>Partner<\/strong> \u2013 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u044b \u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u0438, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0436\u0438\u043b\u044c\u0451 \u0434\u043b\u044f \u0430\u0440\u0435\u043d\u0434\u044b.<\/p>\n<\/li>\n<li>\n<p><strong>Admin<\/strong> \u2013 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u044b \u0441 \u043f\u043e\u043b\u043d\u044b\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e.<\/p>\n<\/li>\n<li>\n<p><strong>TravelAgent<\/strong> \u2013 \u0442\u0443\u0440\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u0433\u0435\u043d\u0442\u044b, \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0443\u044e\u0449\u0438\u0435 \u0442\u0443\u0440\u044b.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439<\/h3>\n<h4>ApplicationUser<\/h4>\n<p>\u042d\u0442\u043e \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 <code>IdentityUser<\/code> .<\/p>\n<pre><code class=\"cs\">public abstract class ApplicationUser : IdentityUser, ICreatedAt, IKey&lt;string&gt; {     public DateTime CreatedAt { get; init; } = DateTime.UtcNow;     public AccountStatus AccountStatus { get; set; } = AccountStatus.Inactive;     [NotMapped] public abstract IdentityRole Role { get; }      \/\/\/ &lt;summary&gt;     \/\/\/ Public name.     \/\/\/ &lt;\/summary&gt;     public string? Name { get; set; } }<\/code><\/pre>\n<p>\u0418\u0437 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0442\u0430\u043a-\u0441\u0435\u0431\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0440\u043e\u043b\u0438 <code>Role<\/code>, \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u0441\u0442\u043e\u0438\u0442, \u043d\u043e \u0438 \u043b\u0443\u0447\u0448\u0435 \u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0430 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u043d\u0435 \u0441\u043c\u043e\u0433.<\/p>\n<h4>ApplicationObject<\/h4>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u0449\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 <code>Partner<\/code> \u0438 <code>TravelAgent<\/code><\/p>\n<pre><code class=\"cs\">public abstract class ApplicationObject : ApplicationUser, IHasTitleImage&lt;ObjectImageLink&gt;, IPublicationStatus {     public string? Description { get; set; }      public string? Coordinates { get; set; }     public string? Address { get; set; }      public PublicationStatus PublicationStatus { get; set; } = PublicationStatus.Unpublished;      [NotMapped] public abstract bool IsPublished { get; }      [NotMapped] public ObjectImageLink? TitleImageLink =&gt; ImageLinks.FirstOrDefault(e =&gt; e.IsTitle);      \/\/ ===      public ICollection&lt;ObjectImageLink&gt; ImageLinks { get; set; } = []; }<\/code><\/pre>\n<h4>Partner<\/h4>\n<pre><code class=\"cs\">public class Partner : ApplicationObject, IHasType&lt;ObjectType&gt; {     [NotMapped] public override IdentityRole Role =&gt; new(nameof(Partner));     [NotMapped] public override bool IsPublished =&gt; PublicationStatus == PublicationStatus.Published &amp;&amp; AccountStatus == AccountStatus.Active;      \/\/ ===      public Guid? TypeId { get; set; }     public virtual ObjectType? Type { get; set; } = null!;      public Guid? CityId { get; set; }     public City? City { get; set; } = null!;      \/\/ Some missing code..      public override string ToString()     {         return $\"{nameof(Partner)}_{Id}\";     } }<\/code><\/pre>\n<h4>TravelAgent<\/h4>\n<pre><code class=\"cs\">public class TravelAgent : ApplicationObject, ISubscriptionStore&lt;TravelAgentSubscription&gt; {     [NotMapped] public override IdentityRole Role =&gt; new(nameof(TravelAgent));      public string? WebsiteUrl { get; set; }      [NotMapped] public override bool IsPublished =&gt; PublicationStatus == PublicationStatus.Published &amp;&amp; AccountStatus == AccountStatus.Active;      \/\/ ===      \/\/ Some missing code..      public ICollection&lt;TravelAgentSubscription&gt; Subscriptions { get; set; } = [];     public ICollection&lt;Tour&gt; Tours { get; set; } = [];      public override string ToString()     {         return $\"{nameof(TravelAgent)}_{Id}\";     } }<\/code><\/pre>\n<h4>Tourist<\/h4>\n<pre><code class=\"cs\">public class Tourist : ApplicationUser {     [NotMapped] public override IdentityRole Role =&gt; new(nameof(Tourist));      public ICollection&lt;Booking&gt; Bookings { get; set; } = [];      \/\/ Some missing code.. }<\/code><\/pre>\n<h4>Admin<\/h4>\n<pre><code class=\"cs\">public class Admin : ApplicationUser {     [NotMapped] public override IdentityRole Role =&gt; new(nameof(Admin)); }<\/code><\/pre>\n<h3>\u041a\u0430\u043a \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435?<\/h3>\n<p>\u041c\u043e\u0434\u0435\u043b\u0438 \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438: \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0438\u0441\u0442\u043e, \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043b\u0435\u0433\u043a\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0442\u0438\u043f\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041a\u0430\u043a \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u043c\u0438 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 ASP.NET? \u0418\u0434\u0451\u043c \u0432 <code>Program.cs<\/code> \u0438 \u043f\u0438\u0448\u0435\u043c \u0442\u0430\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"cs\">\/\/ Some missing code ..  \/\/ BUG: once you set `opt.SignIn.RequireConfirmedEmail` to ANY LAST `ApplicationUser` child here in `Program.cs` \\ \/\/ all user's `RequireConfirmedEmail`-properties will be overwritten.  \/\/ User settings builder.Services.AddIdentity&lt;ApplicationUser, IdentityRole&gt;()     .AddEntityFrameworkStores&lt;ApplicationContext&gt;()     .AddDefaultTokenProviders(); builder.Services.AddIdentityCore&lt;Partner&gt;(opt =&gt; {     opt.SignIn.RequireConfirmedEmail = true; })     .AddEntityFrameworkStores&lt;ApplicationContext&gt;()     .AddDefaultTokenProviders()     .AddSignInManager&lt;SignInManager&lt;Partner&gt;&gt;()     .AddApiEndpoints()     .AddClaimsPrincipalFactory&lt;CustomUserClaimsPrincipalFactory&lt;Partner&gt;&gt;(); builder.Services.AddIdentityCore&lt;Tourist&gt;()     .AddEntityFrameworkStores&lt;ApplicationContext&gt;()     .AddDefaultTokenProviders()     .AddSignInManager&lt;SignInManager&lt;Tourist&gt;&gt;()     .AddApiEndpoints()     .AddClaimsPrincipalFactory&lt;CustomUserClaimsPrincipalFactory&lt;Tourist&gt;&gt;(); builder.Services.AddIdentityCore&lt;TravelAgent&gt;(opt =&gt; {     opt.SignIn.RequireConfirmedEmail = true; })     .AddEntityFrameworkStores&lt;ApplicationContext&gt;()     .AddDefaultTokenProviders()     .AddSignInManager&lt;SignInManager&lt;TravelAgent&gt;&gt;()     .AddApiEndpoints()     .AddClaimsPrincipalFactory&lt;CustomUserClaimsPrincipalFactory&lt;TravelAgent&gt;&gt;(); builder.Services.AddIdentityCore&lt;Admin&gt;(opt =&gt; {     opt.SignIn.RequireConfirmedEmail = true; })     .AddEntityFrameworkStores&lt;ApplicationContext&gt;()     .AddDefaultTokenProviders()     .AddSignInManager&lt;SignInManager&lt;Admin&gt;&gt;()     .AddClaimsPrincipalFactory&lt;CustomUserClaimsPrincipalFactory&lt;Admin&gt;&gt;();  \/\/ NOTE: The following code should be placed AFTER 'AddIdentity' method. builder.Services.ConfigureApplicationCookie(options =&gt; {     options.Cookie.Name = \"Identity.Application\";     options.ExpireTimeSpan = TimeSpan.FromDays(30);      options.Events.OnRedirectToLogin = context =&gt;     {         context.Response.StatusCode = StatusCodes.Status401Unauthorized;         return Task.CompletedTask;     };     options.Events.OnRedirectToAccessDenied = context =&gt;     {         context.Response.StatusCode = StatusCodes.Status403Forbidden;         return Task.CompletedTask;     }; });  var app = builder.Build();  \/\/ Some missing code..<\/code><\/pre>\n<p>\u0427\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u0434\u0435\u0441\u044c?<\/p>\n<h4> \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 RequireConfirmedEmail<\/h4>\n<p><code>options.SignIn.RequireConfirmedEmail<\/code> &#8212; \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0447\u0442\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0431\u044b\u043b\u0430 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0430 (<code>IdentityUser.EmailConfirmed == true<\/code>), \u0438\u043d\u0430\u0447\u0435 \u043e\u043d \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f. <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e <strong>\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443<\/strong>: \u043c\u044b \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 <code>options.SignIn.RequireConfirmedEmail<\/code> \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u043e <u>\u043a\u043e \u0432\u0441\u0435\u043c<\/u> \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u0442\u0438\u043f\u0430\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"cs\">builder.Services.AddIdentityCore&lt;Admin&gt;(opt =&gt; {     opt.SignIn.RequireConfirmedEmail = true; })<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0431\u044b \u043c\u044b \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0437\u0434\u0435\u0441\u044c <code>false<\/code> , \u0442\u043e \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0431\u044b\u043b\u0438 \u0431\u044b \u043f\u0435\u0440\u0435\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0432 <code>false<\/code> .<\/p>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u044f, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0442\u0430\u043a \u0438 \u043d\u0435 \u0441\u043c\u043e\u0433 \u043d\u0430\u0439\u0442\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u044d\u0442\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u043c: \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 email \u043d\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c, \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441\u0442\u0430\u0432\u0438\u043b <code>EmailConfirmed=true<\/code> .<\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Cookies: AddIdentity \u0438 ConfigureApplicationCookie<\/h4>\n<p>\u0412\u044b\u0437\u043e\u0432 <code>AddIdentity<\/code> \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Cookies. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 <code>AddIdentity<\/code> \u0438 <code>ConfigureApplicationCookie<\/code> \u0438\u0433\u0440\u0430\u0435\u0442 \u043a\u043b\u044e\u0447\u0435\u0432\u0443\u044e \u0440\u043e\u043b\u044c, \u0447\u0442\u043e <u>\u0432\u0430\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c<\/u>, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u044d\u0442\u043e \u043d\u0435\u044f\u0432\u043d\u043e, \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c. <\/p>\n<p><em>\u0411\u0435\u0437 \u0443\u0447\u0451\u0442\u0430 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u0430 \u0443 \u043c\u0435\u043d\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Cookies: \u044f \u043d\u0435 \u043c\u043e\u0433 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0436\u0438\u0437\u043d\u0438 \u043a\u0443\u043a\u043e\u0432 \u0438 \u043f\u0440.<\/p>\n<p><\/em><strong>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/strong> \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0434\u043e \u0431\u043e\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u043c: \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432\u044b\u0437\u043e\u0432 <code>ConfigureApplicationCookie<\/code> <u>\u043f\u043e\u0441\u043b\u0435<\/u> <code>AddIdentity<\/code> . <br \/><em>(\u042f, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0441\u043b\u044b\u0448\u0430\u043b, \u0447\u0442\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0440\u044f\u0434\u043e\u043a middleware \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0430\u0436\u0435\u043d, \u043d\u043e \u043f\u0440\u043e \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0437\u0430\u0438\u043a\u0430\u043b\u0441\u044f, \u0438 \u044d\u0442\u043e \u0441\u0442\u0430\u043b\u043e \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e\u0441\u0442\u044c\u044e).<\/em><\/p>\n<h4>CustomUserClaimsPrincipalFactory<\/h4>\n<p><code>CustomUserClaimsPrincipalFactory<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0440\u043e\u043b\u0438 \u0438\u0437 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <code>Role<\/code> \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439. \u042d\u0442\u043e \u0434\u0430\u0451\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>[Authorize]<\/code> \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430.<\/p>\n<pre><code class=\"cs\">public class CustomUserClaimsPrincipalFactory&lt;TUser&gt; : UserClaimsPrincipalFactory&lt;TUser&gt; where TUser : ApplicationUser {     private readonly ILogger&lt;CustomUserClaimsPrincipalFactory&lt;TUser&gt;&gt; _logger;      public CustomUserClaimsPrincipalFactory(         UserManager&lt;TUser&gt; userManager,         IOptions&lt;IdentityOptions&gt; optionsAccessor,         ILogger&lt;CustomUserClaimsPrincipalFactory&lt;TUser&gt;&gt; logger)         : base(userManager, optionsAccessor)     {         _logger = logger;     }      protected override async Task&lt;ClaimsIdentity&gt; GenerateClaimsAsync(TUser user)     {         ClaimsIdentity identity = await base.GenerateClaimsAsync(user);          \/\/ Add custom Claim based on `Role`.         identity.AddClaim(new Claim(ClaimTypes.Role, user.Role.Name!));         _logger.LogInformation(\"A Role Claim was added with value '{Name}' to '{User}'\", user.Role.Name, user);          return identity;     } }<\/code><\/pre>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 ASP.NET. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441\u044b, \u043c\u043d\u0435 \u0442\u0430\u043a\u0438 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/872656\/\"> https:\/\/habr.com\/ru\/articles\/872656\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u043d\u0430\u0437\u0430\u0434 \u044f \u043d\u0430\u0447\u0430\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0431\u044d\u043a\u044d\u043d\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 ASP.NET API. \u041f\u0440\u043e\u0435\u043a\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u043b \u0441\u043e\u0431\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u0431\u0440\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0442\u0435\u043b\u0435\u0439 (Airbnb \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u043b \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0440\u0435\u0444\u0435\u0440\u0435\u043d\u0441\u043e\u043c). \u041e\u043f\u044b\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 ASP.NET \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u043b\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e: \u043c\u043d\u043e\u0433\u043e\u043c\u0443 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0431\u0443\u0447\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435, \u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u043e \u0447\u0430\u0441\u044b, \u0430 \u0442\u043e \u0438 \u0434\u043d\u0438.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0434\u0435\u043b\u044e\u0441\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u0438 \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c\u0438 \u0438 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u0435 \u0441\u0430\u043c\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435<\/p>\n<h2>\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c: \u0440\u0430\u0437\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 <\/h2>\n<p> \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0438\u043f\u043e\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u0432\u043e\u044e \u0440\u043e\u043b\u044c:<\/p>\n<ul>\n<li>\n<p><strong>Tourist<\/strong> \u2013 \u0442\u0443\u0440\u0438\u0441\u0442\u044b, \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0449\u0443\u0442 \u0436\u0438\u043b\u044c\u0451 \u0434\u043b\u044f \u0431\u0440\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u0431\u0440\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u043c\u0435\u0440\u0430 \u0438 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u0442\u0437\u044b\u0432\u044b.<\/p>\n<\/li>\n<li>\n<p><strong>Partner<\/strong> \u2013 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u044b \u043d\u0435\u0434\u0432\u0438\u0436\u0438\u043c\u043e\u0441\u0442\u0438, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0436\u0438\u043b\u044c\u0451 \u0434\u043b\u044f \u0430\u0440\u0435\u043d\u0434\u044b.<\/p>\n<\/li>\n<li>\n<p><strong>Admin<\/strong> \u2013 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u044b \u0441 \u043f\u043e\u043b\u043d\u044b\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e.<\/p>\n<\/li>\n<li>\n<p><strong>TravelAgent<\/strong> \u2013 \u0442\u0443\u0440\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u0433\u0435\u043d\u0442\u044b, \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0443\u044e\u0449\u0438\u0435 \u0442\u0443\u0440\u044b.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439<\/h3>\n<h4>ApplicationUser<\/h4>\n<p>\u042d\u0442\u043e \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 <code>IdentityUser<\/code> .<\/p>\n<pre><code class=\"cs\">public abstract class ApplicationUser : IdentityUser, ICreatedAt, IKey&lt;string&gt; {     public DateTime CreatedAt { get; init; } = DateTime.UtcNow;     public AccountStatus AccountStatus { get; set; } = AccountStatus.Inactive;     [NotMapped] public abstract IdentityRole Role { get; }      \/\/\/ &lt;summary&gt;     \/\/\/ Public name.     \/\/\/ &lt;\/summary&gt;     public string? Name { get; set; } }<\/code><\/pre>\n<p>\u0418\u0437 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0442\u0430\u043a-\u0441\u0435\u0431\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0440\u043e\u043b\u0438 <code>Role<\/code>, \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u0441\u0442\u043e\u0438\u0442, \u043d\u043e \u0438 \u043b\u0443\u0447\u0448\u0435 \u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0430 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u043d\u0435 \u0441\u043c\u043e\u0433.<\/p>\n<h4>ApplicationObject<\/h4>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u0449\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 <code>Partner<\/code> \u0438 <code>TravelAgent<\/code><\/p>\n<pre><code class=\"cs\">public abstract class ApplicationObject : ApplicationUser, IHasTitleImage&lt;ObjectImageLink&gt;, IPublicationStatus {     public string? Description { get; set; }      public string? Coordinates { get; set; }     public string? Address { get; set; }      public PublicationStatus PublicationStatus { get; set; } = PublicationStatus.Unpublished;      [NotMapped] public abstract bool IsPublished { get; }      [NotMapped] public ObjectImageLink? TitleImageLink =&gt; ImageLinks.FirstOrDefault(e =&gt; e.IsTitle);      \/\/ ===      public ICollection&lt;ObjectImageLink&gt; ImageLinks { get; set; } = []; }<\/code><\/pre>\n<h4>Partner<\/h4>\n<pre><code class=\"cs\">public class Partner : ApplicationObject, IHasType&lt;ObjectType&gt; {     [NotMapped] public override IdentityRole Role =&gt; new(nameof(Partner));     [NotMapped] public override bool IsPublished =&gt; PublicationStatus == PublicationStatus.Published &amp;&amp; AccountStatus == AccountStatus.Active;      \/\/ ===      public Guid? TypeId { get; set; }     public virtual ObjectType? Type { get; set; } = null!;      public Guid? CityId { get; set; }     public City? City { get; set; } = null!;      \/\/ Some missing code..      public override string ToString()     {         return $\"{nameof(Partner)}_{Id}\";     } }<\/code><\/pre>\n<h4>TravelAgent<\/h4>\n<pre><code class=\"cs\">public class TravelAgent : ApplicationObject, ISubscriptionStore&lt;TravelAgentSubscription&gt; {     [NotMapped] public override IdentityRole Role =&gt; new(nameof(TravelAgent));      public string? WebsiteUrl { get; set; }      [NotMapped] public override bool IsPublished =&gt; PublicationStatus == PublicationStatus.Published &amp;&amp; AccountStatus == AccountStatus.Active;      \/\/ ===      \/\/ Some missing code..      public ICollection&lt;TravelAgentSubscription&gt; Subscriptions { get; set; } = [];     public ICollection&lt;Tour&gt; Tours { get; set; } = [];      public override string ToString()     {         return $\"{nameof(TravelAgent)}_{Id}\";     } }<\/code><\/pre>\n<h4>Tourist<\/h4>\n<pre><code class=\"cs\">public class Tourist : ApplicationUser {     [NotMapped] public override IdentityRole Role =&gt; new(nameof(Tourist));      public ICollection&lt;Booking&gt; Bookings { get; set; } = [];      \/\/ Some missing code.. }<\/code><\/pre>\n<h4>Admin<\/h4>\n<pre><code class=\"cs\">public class Admin : ApplicationUser {     [NotMapped] public override IdentityRole Role =&gt; new(nameof(Admin)); }<\/code><\/pre>\n<h3>\u041a\u0430\u043a \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435?<\/h3>\n<p>\u041c\u043e\u0434\u0435\u043b\u0438 \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438: \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0438\u0441\u0442\u043e, \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043b\u0435\u0433\u043a\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0442\u0438\u043f\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041a\u0430\u043a \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u043c\u0438 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 ASP.NET? \u0418\u0434\u0451\u043c \u0432 <code>Program.cs<\/code> \u0438 \u043f\u0438\u0448\u0435\u043c \u0442\u0430\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"cs\">\/\/ Some missing code ..  \/\/ BUG: once you set `opt.SignIn.RequireConfirmedEmail` to ANY LAST `ApplicationUser` child here in `Program.cs` \\ \/\/ all user's `RequireConfirmedEmail`-properties will be overwritten.  \/\/ User settings builder.Services.AddIdentity&lt;ApplicationUser, IdentityRole&gt;()     .AddEntityFrameworkStores&lt;ApplicationContext&gt;()     .AddDefaultTokenProviders(); builder.Services.AddIdentityCore&lt;Partner&gt;(opt =&gt; {     opt.SignIn.RequireConfirmedEmail = true; })     .AddEntityFrameworkStores&lt;ApplicationContext&gt;()     .AddDefaultTokenProviders()     .AddSignInManager&lt;SignInManager&lt;Partner&gt;&gt;()     .AddApiEndpoints()     .AddClaimsPrincipalFactory&lt;CustomUserClaimsPrincipalFactory&lt;Partner&gt;&gt;(); builder.Services.AddIdentityCore&lt;Tourist&gt;()     .AddEntityFrameworkStores&lt;ApplicationContext&gt;()     .AddDefaultTokenProviders()     .AddSignInManager&lt;SignInManager&lt;Tourist&gt;&gt;()     .AddApiEndpoints()     .AddClaimsPrincipalFactory&lt;CustomUserClaimsPrincipalFactory&lt;Tourist&gt;&gt;(); builder.Services.AddIdentityCore&lt;TravelAgent&gt;(opt =&gt; {     opt.SignIn.RequireConfirmedEmail = true; })     .AddEntityFrameworkStores&lt;ApplicationContext&gt;()     .AddDefaultTokenProviders()     .AddSignInManager&lt;SignInManager&lt;TravelAgent&gt;&gt;()     .AddApiEndpoints()     .AddClaimsPrincipalFactory&lt;CustomUserClaimsPrincipalFactory&lt;TravelAgent&gt;&gt;(); builder.Services.AddIdentityCore&lt;Admin&gt;(opt =&gt; {     opt.SignIn.RequireConfirmedEmail = true; })     .AddEntityFrameworkStores&lt;ApplicationContext&gt;()     .AddDefaultTokenProviders()     .AddSignInManager&lt;SignInManager&lt;Admin&gt;&gt;()     .AddClaimsPrincipalFactory&lt;CustomUserClaimsPrincipalFactory&lt;Admin&gt;&gt;();  \/\/ NOTE: The following code should be placed AFTER 'AddIdentity' method. builder.Services.ConfigureApplicationCookie(options =&gt; {     options.Cookie.Name = \"Identity.Application\";     options.ExpireTimeSpan = TimeSpan.FromDays(30);      options.Events.OnRedirectToLogin = context =&gt;     {         context.Response.StatusCode = StatusCodes.Status401Unauthorized;         return Task.CompletedTask;     };     options.Events.OnRedirectToAccessDenied = context =&gt;     {         context.Response.StatusCode = StatusCodes.Status403Forbidden;         return Task.CompletedTask;     }; });  var app = builder.Build();  \/\/ Some missing code..<\/code><\/pre>\n<p>\u0427\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u0434\u0435\u0441\u044c?<\/p>\n<h4> \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 RequireConfirmedEmail<\/h4>\n<p><code>options.SignIn.RequireConfirmedEmail<\/code> &#8212; \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0447\u0442\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0431\u044b\u043b\u0430 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0430 (<code>IdentityUser.EmailConfirmed == true<\/code>), \u0438\u043d\u0430\u0447\u0435 \u043e\u043d \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f. <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e <strong>\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443<\/strong>: \u043c\u044b \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 <code>options.SignIn.RequireConfirmedEmail<\/code> \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u043e <u>\u043a\u043e \u0432\u0441\u0435\u043c<\/u> \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u0442\u0438\u043f\u0430\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"cs\">builder.Services.AddIdentityCore&lt;Admin&gt;(opt =&gt; {     opt.SignIn.RequireConfirmedEmail = true; })<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0431\u044b \u043c\u044b \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0437\u0434\u0435\u0441\u044c <code>false<\/code> , \u0442\u043e \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0431\u044b\u043b\u0438 \u0431\u044b \u043f\u0435\u0440\u0435\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0432 <code>false<\/code> .<\/p>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u044f, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0442\u0430\u043a \u0438 \u043d\u0435 \u0441\u043c\u043e\u0433 \u043d\u0430\u0439\u0442\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u044d\u0442\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u043c: \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 email \u043d\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c, \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441\u0442\u0430\u0432\u0438\u043b <code>EmailConfirmed=true<\/code> .<\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Cookies: AddIdentity \u0438 ConfigureApplicationCookie<\/h4>\n<p>\u0412\u044b\u0437\u043e\u0432 <code>AddIdentity<\/code> \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Cookies. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 <code>AddIdentity<\/code> \u0438 <code>ConfigureApplicationCookie<\/code> \u0438\u0433\u0440\u0430\u0435\u0442 \u043a\u043b\u044e\u0447\u0435\u0432\u0443\u044e \u0440\u043e\u043b\u044c, \u0447\u0442\u043e <u>\u0432\u0430\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c<\/u>, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u044d\u0442\u043e \u043d\u0435\u044f\u0432\u043d\u043e, \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c. <\/p>\n<p><em>\u0411\u0435\u0437 \u0443\u0447\u0451\u0442\u0430 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u0430 \u0443 \u043c\u0435\u043d\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Cookies: \u044f \u043d\u0435 \u043c\u043e\u0433 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0436\u0438\u0437\u043d\u0438 \u043a\u0443\u043a\u043e\u0432 \u0438 \u043f\u0440.<\/p>\n<p><\/em><strong>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/strong> \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0434\u043e \u0431\u043e\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u043c: \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432\u044b\u0437\u043e\u0432 <code>ConfigureApplicationCookie<\/code> <u>\u043f\u043e\u0441\u043b\u0435<\/u> <code>AddIdentity<\/code> . <br \/><em>(\u042f, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0441\u043b\u044b\u0448\u0430\u043b, \u0447\u0442\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0440\u044f\u0434\u043e\u043a middleware \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0430\u0436\u0435\u043d, \u043d\u043e \u043f\u0440\u043e \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0437\u0430\u0438\u043a\u0430\u043b\u0441\u044f, \u0438 \u044d\u0442\u043e \u0441\u0442\u0430\u043b\u043e \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e\u0441\u0442\u044c\u044e).<\/em><\/p>\n<h4>CustomUserClaimsPrincipalFactory<\/h4>\n<p><code>CustomUserClaimsPrincipalFactory<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0440\u043e\u043b\u0438 \u0438\u0437 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <code>Role<\/code> \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439. \u042d\u0442\u043e \u0434\u0430\u0451\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>[Authorize]<\/code> \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430.<\/p>\n<pre><code class=\"cs\">public class CustomUserClaimsPrincipalFactory&lt;TUser&gt; : UserClaimsPrincipalFactory&lt;TUser&gt; where TUser : ApplicationUser {     private readonly ILogger&lt;CustomUserClaimsPrincipalFactory&lt;TUser&gt;&gt; _logger;      public CustomUserClaimsPrincipalFactory(         UserManager&lt;TUser&gt; userManager,         IOptions&lt;IdentityOptions&gt; optionsAccessor,         ILogger&lt;CustomUserClaimsPrincipalFactory&lt;TUser&gt;&gt; logger)         : base(userManager, optionsAccessor)     {         _logger = logger;     }      protected override async Task&lt;ClaimsIdentity&gt; GenerateClaimsAsync(TUser user)     {         ClaimsIdentity identity = await base.GenerateClaimsAsync(user);          \/\/ Add custom Claim based on `Role`.         identity.AddClaim(new Claim(ClaimTypes.Role, user.Role.Name!));         _logger.LogInformation(\"A Role Claim was added with value '{Name}' to '{User}'\", user.Role.Name, user);          return identity;     } }<\/code><\/pre>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 ASP.NET. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441\u044b, \u043c\u043d\u0435 \u0442\u0430\u043a\u0438 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/872656\/\"> https:\/\/habr.com\/ru\/articles\/872656\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-444654","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/444654","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=444654"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/444654\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=444654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=444654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=444654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}