RepositoryC#CHThụy Sĩ
DA

damienbod/bff-aspnetcore-angular

Backend for frontend security using Angular CLI and ASP.NET Core backend

148sao
25fork
3issue
4lượt xem

Thành tựu nổi bật

Những danh hiệu mới nhất của dự án

1
TINIX TRENDING·Chủ đề: azuread

#1 Repository của tháng

1
TINIX TRENDING·Chủ đề: bff

#1 Repository của tháng

1
TINIX TRENDING·Chủ đề: yarp

#1 Repository của tháng

🔐 BFF an toàn: Kết nối Angular + ASP.NET Core qua YARP

Kiến trúc Backend-for-Frontend (BFF) giúp bảo vệ ứng dụng Angular bằng ASP.NET Core, dùng cookie xác thực và proxy an toàn.

Dự án bff-aspnetcore-angular của damienbod cung cấp một mẫu kiến trúc BFF an toàn, kết hợp Angular CLI phía trước và ASP.NET Core phía sau. Trong môi trường phát triển, YARP (Yet Another Reverse Proxy) được dùng để chuyển tiếp yêu cầu từ Angular sang backend. Trong sản phẩm thực tế, Angular được build ra wwwroot của dự án .NET.

✨ Điểm nổi bật

  • YARP Reverse Proxy: Dùng để proxy các yêu cầu từ Angular CLI trong môi trường phát triển.
  • Xác thực bằng cookie: Sử dụng cookie để quản lý phiên người dùng một cách an toàn.
  • Hỗ trợ HTTPS: Luôn chạy qua HTTPS cả trong phát triển lẫn sản xuất.
  • Azure AD / Entra ID: Xác thực người dùng bằng OpenID Connect thông qua Microsoft.Identity.Web.
  • CSP & CSRF: Cấu hình Content Security Policy và bảo vệ chống CSRF.
  • OBO Flow: Hỗ trợ gọi downstream API bằng On-Behalf-Of flow.
  • Triển khai Angular vào wwwroot: Build Angular ra thư mục wwwroot của .NET trong production.
  • Cấu hình môi trường phát triển linh hoạt: Hỗ trợ hot reload và các route phát triển của Angular.

💡 Vì sao đáng chú ý

Đây là một giải pháp thực tế để xây dựng ứng dụng đa tầng an toàn với Angular và .NET, tránh các lỗ hổng thường gặp như expose trực tiếp API hoặc lưu token ở frontend. Kiến trúc BFF giúp tập trung logic bảo mật ở backend, trong khi Angular chỉ nhận dữ liệu đã được xác thực.

Phù hợp với các dự án doanh nghiệp cần tích hợp xác thực Microsoft Entra ID và gọi các API phụ thuộc như Microsoft Graph.


#BFF #Angular #ASPNETCore #YARP #Security #AzureAD #TiniX

Dự án tương tự

Khám phá các dự án và mô hình AI khác có sự tương đồng.

RepositoryC#
RicoSuter/NSwag

The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.

7.4k
Nov 11, 2026
RepositoryC#
DuendeSoftware/products

The most flexible and standards-compliant OpenID Connect and OAuth 2.x framework for ASP.NET Core

1.6k
Nov 30, 2026
RepositoryRuby
github/secure_headers

Manages application of security headers with many safe defaults

3.2k
Nov 25, 2026
RepositoryPHP
aidantwoods/SecureHeaders

A PHP library aiming to make the use of browser security features more accessible.

429
Nov 17, 2023
RepositoryJava
dschadow/JavaSecurity

Java web and command line applications demonstrating various security topics

240
Nov 24, 2026
RepositoryHTML
zh54321/GraphPreConsentExplorer

A comprehensive list of usable Entra ID first-party clients with pre-consented Microsoft Graph scopes, in a simple YAML-file explorable with a simple HTML GUI.

175
Nov 21, 2026
RepositoryJavaScript
kevin-mizu/GMSGadget

This repository is a collection of JavaScript gadgets that can be used to bypass XSS mitigations such as Content Security Policy (CSP) and HTML sanitizers like DOMPurify.

155
Feb 4, 2026
RepositoryJavaScript
electrode-io/electrode-csrf-jwt

Stateless Cross-Site Request Forgery (CSRF) protection with JWT

125
Feb 10, 2025
RepositoryPowerShell
nicolonsky/ITDR

Collection of Microsoft Identity Threat Detection and Response resources.

58
Nov 1, 2026