Hi @Anjaneyulu, I think you don't need to create a manual Anti Forgery Token Middleware. Instead, you can define
AbpAntiForgeryOptions
to enable auto validation for GET requests.Configure<AbpAntiForgeryOptions>(options => { //By default only POST requests auto validate anti forgery tokens. //In other word "GET", "HEAD", "TRACE" and "OPTIONS" HTTP methods are ignored. options.AutoValidateIgnoredHttpMethods.Remove("GET"); //auto validate for GET requests });
See CSRF Anti Forgery documentation for more information
Hi @EngincanV , I have configured as you said
Configure<AbpAntiForgeryOptions>(options => { //By default only POST requests auto validate anti forgery tokens. //In other word "GET", "HEAD", "TRACE" and "OPTIONS" HTTP methods are ignored.
options.AutoValidateIgnoredHttpMethods.Remove("GET"); //auto validate for GET requests });
Im not receving any data in get request. Do i need to add anything else ?
hi
Is
Emailing\Templates\Templates\*.tpl
path correct?Maybe
Emailing\Templates\*.tpl
I have updated the path. Also, tried setting build actions to copy always for embedded resources. But im getting the same issue.
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="....\common.props" />
<PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> <RootNamespace>Test</RootNamespace> </PropertyGroup>
<ItemGroup> <ProjectReference Include="..\Test.Domain.Shared\Test.Domain.Shared.csproj" /> </ItemGroup>
<ItemGroup> <ProjectReference Include="....\modules\Volo.Account.Pro\src\Volo.Abp.Account.Pro.Shared.Application.Contracts\Volo.Abp.Account.Pro.Shared.Application.Contracts.csproj" /> <PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" Version="4.4.2" /> <PackageReference Include="Volo.Abp.FeatureManagement.Application.Contracts" Version="4.4.2" /> <PackageReference Include="Volo.Abp.SettingManagement.Application.Contracts" Version="4.4.2" /> <PackageReference Include="Volo.Saas.Host.Application.Contracts" Version="4.4.2" /> <PackageReference Include="Volo.Abp.AuditLogging.Application.Contracts" Version="4.4.2" /> <ProjectReference Include="....\modules\Volo.Identity.Pro\src\Volo.Abp.Identity.Pro.Application.Contracts\Volo.Abp.Identity.Pro.Application.Contracts.csproj" /> <PackageReference Include="Volo.Abp.IdentityServer.Application.Contracts" Version="4.4.2" /> <ProjectReference Include="....\modules\Volo.Account.Pro\src\Volo.Abp.Account.Pro.Public.Application.Contracts\Volo.Abp.Account.Pro.Public.Application.Contracts.csproj" /> <ProjectReference Include="....\modules\Volo.Account.Pro\src\Volo.Abp.Account.Pro.Admin.Application.Contracts\Volo.Abp.Account.Pro.Admin.Application.Contracts.csproj" /> <PackageReference Include="Volo.Abp.LanguageManagement.Application.Contracts" Version="4.4.2" /> <ProjectReference Include="....\modules\Volo.TextTemplateManagement\src\Volo.Abp.TextTemplateManagement.Application.Contracts\Volo.Abp.TextTemplateManagement.Application.Contracts.csproj" /> <ProjectReference Include="....\modules\Volo.LeptonTheme\src\Volo.Abp.LeptonTheme.Management.Application.Contracts\Volo.Abp.LeptonTheme.Management.Application.Contracts.csproj" /> </ItemGroup>
<ItemGroup> <EmbeddedResource Include="Emailing\Templates*.tpl" /> <None Remove="Emailing\Templates*.tpl" /> </ItemGroup>
</Project>
hi
Can you share the csproj(ApplicationContractModule) file?
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>Test</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Test.Domain.Shared\Test.Domain.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\modules\Volo.Account.Pro\src\Volo.Abp.Account.Pro.Shared.Application.Contracts\Volo.Abp.Account.Pro.Shared.Application.Contracts.csproj" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" Version="4.4.2" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application.Contracts" Version="4.4.2" />
<PackageReference Include="Volo.Abp.SettingManagement.Application.Contracts" Version="4.4.2" />
<PackageReference Include="Volo.Saas.Host.Application.Contracts" Version="4.4.2" />
<PackageReference Include="Volo.Abp.AuditLogging.Application.Contracts" Version="4.4.2" />
<ProjectReference Include="..\..\modules\Volo.Identity.Pro\src\Volo.Abp.Identity.Pro.Application.Contracts\Volo.Abp.Identity.Pro.Application.Contracts.csproj" />
<PackageReference Include="Volo.Abp.IdentityServer.Application.Contracts" Version="4.4.2" />
<ProjectReference Include="..\..\modules\Volo.Account.Pro\src\Volo.Abp.Account.Pro.Public.Application.Contracts\Volo.Abp.Account.Pro.Public.Application.Contracts.csproj" />
<ProjectReference Include="..\..\modules\Volo.Account.Pro\src\Volo.Abp.Account.Pro.Admin.Application.Contracts\Volo.Abp.Account.Pro.Admin.Application.Contracts.csproj" />
<PackageReference Include="Volo.Abp.LanguageManagement.Application.Contracts" Version="4.4.2" />
<ProjectReference Include="..\..\modules\Volo.TextTemplateManagement\src\Volo.Abp.TextTemplateManagement.Application.Contracts\Volo.Abp.TextTemplateManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\..\modules\Volo.LeptonTheme\src\Volo.Abp.LeptonTheme.Management.Application.Contracts\Volo.Abp.LeptonTheme.Management.Application.Contracts.csproj" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Emailing\Templates\Templates\*.tpl" />
<None Remove="Emailing\Templates\Templates\*.tpl" />
</ItemGroup>
</Project>
hi
You are configure the
ApplicationCookie
notXSRF
andAntiforgery
.Can you explain the reason to change the
path
?
Hi,
Basically when i hosted the application cookie path is coming as default root path i.e., path='/'.
But i want to set the path to application folder in IIS when hosted.
Can you please help to set that properly.