mirror of https://github.com/abpframework/abp.git
10 changed files with 47 additions and 23 deletions
@ -1,23 +1,33 @@ |
|||||
namespace Volo.Abp.AspNetCore.Mvc.AntiForgery |
using System; |
||||
|
using Microsoft.AspNetCore.Http; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.AntiForgery |
||||
{ |
{ |
||||
public class AbpAntiForgeryOptions |
public class AbpAntiForgeryOptions |
||||
{ |
{ |
||||
/// <summary>
|
/// <summary>
|
||||
/// Get/sets cookie name to transfer Anti Forgery token between server and client.
|
/// Use to set the cookie options to transfer Anti Forgery token between server and client.
|
||||
/// Default value: "XSRF-TOKEN".
|
/// Default name of the cookie: "XSRF-TOKEN".
|
||||
/// </summary>
|
/// </summary>
|
||||
public string TokenCookieName { get; set; } |
public CookieBuilder TokenCookie { get; } |
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// Used to find auth cookie when validating Anti Forgery token.
|
/// Used to find auth cookie when validating Anti Forgery token.
|
||||
/// Default value: ".AspNetCore.Identity.Application".
|
/// Default value: "Identity.Application".
|
||||
/// </summary>
|
/// </summary>
|
||||
public string AuthCookieName { get; set; } |
public string AuthCookieSchemaName { get; set; } |
||||
|
|
||||
public AbpAntiForgeryOptions() |
public AbpAntiForgeryOptions() |
||||
{ |
{ |
||||
TokenCookieName = "XSRF-TOKEN"; |
TokenCookie = new CookieBuilder |
||||
AuthCookieName = ".AspNetCore.Identity.Application"; |
{ |
||||
|
Name = "XSRF-TOKEN", |
||||
|
HttpOnly = false, |
||||
|
IsEssential = true, |
||||
|
Expiration = TimeSpan.FromDays(3650) //10 years!
|
||||
|
}; |
||||
|
|
||||
|
AuthCookieSchemaName = "Identity.Application"; |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue