Learn it from developers who built it.
Tutorials, how-tos and deep dives on AI, .NET, C#, cloud and developer tools, written by the community.
Secure your ASP.NET Core APIs! This article dives into preventing CORS misconfigurations, a critical aspect of web application security. Learn how overly permissive CORS settings can lead to vulnerabilities like data theft and CSRF. Discover best practices for configuring CORS correctly, including defining trusted origins, restricting methods and headers, and handling credentials safely.

This article provides a comprehensive guide to protecting against XSS, clickjacking, and other common web vulnerabilities. Learn how to implement HSTS, CSP, X-Frame-Options, and more with practical code examples and best practices. Boost your app's security rating and safeguard user data with these easy-to-implement security measures, including middleware implementation and testing strategies.

This article simplifies using appsettings.json and IConfiguration to manage application settings like database connections, API keys, and logging levels. Learn how to access settings, leverage strongly typed classes, and implement environment-specific configurations for secure and scalable applications. Master best practices for handling sensitive data and building cloud-ready solutions with ease.

Protect your ASP.NET Core applications from clickjacking attacks! This guide explains how to implement robust defenses using X-Frame-Options and Content Security Policy (CSP) with frame-ancestors. Learn to prevent malicious embedding of your site in iframes, safeguarding users from unintended actions. Discover practical examples using middleware and the NWebsec library for easier, more secure implementation. Ensure compatibility across browsers and fortify your application's security posture.

Confused about HTML Tag Helpers vs. ASP.NET Core Tag Helpers? This article clarifies the differences between standard HTML elements and ASP.NET Core's server-side helpers. Learn how Tag Helpers enhance Razor views with C# logic, improve SEO with clean URLs, and simplify model binding. Discover practical examples and benefits for cleaner, more maintainable ASP.NET Core web applications. Understand when and why to use each for optimal web development.

Understand the key differences between Kestrel and IIS for ASP.NET Core hosting. Kestrel is a cross-platform, open-source web server known for its speed and efficiency, ideal for modern cloud environments. IIS, a Windows-specific server, offers robust enterprise features like security and logging. Learn when to use each, or combine them for optimal performance and security. Discover the best approach for your application's needs.

This article details built-in mechanisms like anti-forgery tokens, SameSite cookies, and global validation to safeguard authenticated users. Learn how to implement CSRF protection in Razor Pages, MVC, AJAX, and Web APIs, ensuring your application is secure against unauthorized actions.

Enhance your ASP.NET Core application security with Multi-Factor Authentication (MFA). Learn how to implement MFA using ASP.NET Core Identity with authenticator apps, SMS, and email. This guide covers setup, code verification, and best practices like using TOTP over SMS, providing recovery codes, and securing token providers.

Learn how to prevent session hijacking and cookie theft in ASP.NET Core using secure cookie settings, short lifetimes, security-stamp validation, XSS and CSRF defenses, MFA, and session monitoring.

Master ASP.NET Core Identity for robust authentication! Learn to configure Identity, enforce strong password policies, implement Two-Factor Authentication (2FA), and use claims-based authorization. Secure your application with email confirmation, account lockout, and hardened cookie settings. Follow these best practices to build a secure, scalable, and maintainable ASP.NET Core application.

Learn how to secure your ASP.NET Core APIs using JWT (JSON Web Tokens) for authentication and OAuth2 for authorization. This guide covers implementation steps, including NuGet package installation, configuration in Program.cs, token generation, and securing API endpoints. Explore best practices like HTTPS, token expiration, and issuer validation to build robust and reliable APIs.

Secure your ASP.NET Core MVC applications with role-based authorization! This guide provides a step-by-step walkthrough, complete with code examples, on implementing roles (Admin, Manager, User) using ASP.NET Core Identity. Learn to configure Identity, seed roles, assign roles to users, and restrict access at the controller, action, and view levels. Explore policy-based authorization for cleaner role management and best practices for robust security. Master role-based access control today!

Securely serve files in ASP.NET Core by implementing authorization checks and preventing unauthorized access. Learn how to protect sensitive documents like invoices and reports by storing them outside the wwwroot folder and serving them through controller endpoints. This guide covers project setup, secure file controller creation, fine-grained authorization, and using IAuthorizationService for custom policies.

Learn how ASP.NET Core MVC binds form, route, query, and JSON request data to models, then validates it with data annotations and ModelState.

Learn how to implement secure file upload handling in ASP.NET Core MVC applications. This article covers essential security best practices, including limiting file size, restricting file types, using safe filenames, and storing files outside the webroot to prevent direct access.

Protect your ASP.NET Core applications from path traversal and directory browsing attacks! Learn practical mitigation strategies, including disabling directory browsing, sanitizing file paths with Path.GetFileName, restricting upload directories, validating file types, and applying the principle of least privilege. Secure your web applications and prevent unauthorized access to sensitive files by implementing these essential security measures. Harden your web.config and monitor logs for suspicious activity.

Enhance the security of your ASP.NET Core projects with these essential rules and best practices. Learn how to protect against common vulnerabilities like XSS, CSRF, and SQL injection. Implement robust authentication, secure cookie handling, and proper secret management. Keep your application safe by staying updated and applying the principle of least privilege.

Learn how to prevent mass assignment and overposting in ASP.NET Core Web APIs using DTOs, explicit mapping, property whitelisting, and authorization checks.

Protect your ASP.NET Core APIs from JSON injection and malformed payloads! This guide details how to prevent attacks like privilege escalation, DoS, and XSS. Learn to use DTOs, strict validation, request limits, and content-type enforcement. Secure your application by implementing these best practices for robust JSON parsing and handling, ensuring data integrity and application stability against malicious input.

Secure your ASP.NET Core applications! This guide provides an end-to-end example of input validation and sanitization, crucial for preventing XSS, SQL injection, and other attacks. Learn how to use DTOs, HtmlSanitizer, and middleware to protect your application from malicious user input. Implement best practices like CSRF protection and password hashing for robust security. Build resilient and safe web applications with this comprehensive tutorial.

Secure your ASP.NET Core REST APIs with this comprehensive guide! Learn essential techniques for authentication using JWT, role-based authorization, and robust input validation. Protect against common threats like CSRF and DoS attacks with HTTPS, data encryption, and rate limiting. Implement logging, monitoring, and keep dependencies updated for continuous security. Build resilient APIs and safeguard your applications!

Comprehensive guide to securing ASP.NET Core applications with HTTPS, HSTS, and TLS. Learn step-by-step how to enforce encrypted communication, prevent downgrade attacks, and configure secure protocols from development to production. Includes TLS configuration in Kestrel, secure cookies, production certificate management, and CI/CD deployment considerations.

Fortify your ASP.NET Core MVC & Web API applications with these essential secure coding guidelines. Learn practical techniques to prevent common vulnerabilities like XSS, CSRF, and SQL injection. Implement robust authentication, input validation, and API security measures. Protect sensitive data, manage dependencies securely, and enhance performance to defend against DoS attacks. Build resilient and secure applications today!

Protect your ASP.NET Core MVC and Web API applications from critical vulnerabilities! This article provides essential best practices for securing file uploads and user inputs. Learn how to prevent SQL injection, XSS, path traversal, malware uploads, and DoS attacks through robust validation, secure file handling, and API security measures.

Unlock the secrets of Partial Views and ViewComponents in ASP.NET MVC/Core! This guide dives deep into their differences, exploring usage, performance, and best-use cases. Learn when to use each for optimal code reusability and maintainability. Discover how Partial Views excel at static content while ViewComponents shine with dynamic, data-driven widgets. Elevate your ASP.NET development skills today!

Compare Newtonsoft.Json with System.Text.Json in ASP.NET Core and .NET 8, including serialization performance, memory use, built-in support, and cases where Newtonsoft.Json is still useful.

Single-page applications (SPAs) deliver faster, dynamic, app-like web experiences by loading content without requiring page refreshes. Built with frameworks like React, Angular, or Vue, they enhance performance and user engagement.

Secure your ASP.NET Core Web APIs with JWT authentication! This guide covers implementation, role-based authorization, and OWASP API Top 10 threat mitigation.

IServiceScopeFactory in .NET enables the manual creation of scoped services, allowing singletons and background tasks to safely utilize scoped dependencies. This ensures proper disposal, prevents memory leaks, and maintains DI lifetimes.

Puppeteer Sharp enables .NET apps to generate browser-quality PDFs from HTML, supporting modern CSS, JavaScript, and dynamic content. Automate the creation of PDFs for invoices, tickets, or web pages with ease and accuracy.
Everything on ASP.NET Core, not only its articles: the ASP.NET Core page →
DevSocialUpcoming · 3rd editionAI Agents ConferenceNov 23–27, 2026Live onlineMembers only16days leftRegisterMembers onlyWrite an article and earn +1,000 SHARP when it is approved.
Write an article