π Authentication & Authorization System
A full-stack authentication and authorization system built using Angular, ASP.NET Core 8 Web API, SQL Server, and JWT, featuring secure authentication practices including Refresh Token Rotation, HTTP-Only Cookie Authentication, and Google Sign-In with OpenID Connect (OIDC).
This project demonstrates a production-oriented authentication flow by combining modern identity management techniques with secure backend architecture and best practices.
β¨ Features
###Authentication
- User Registration
- User Login
- Secure Logout
- Protected API Endpoints
- Role-based Authentication Ready
###JWT Authentication
- JWT Access Token Authentication
- Refresh Token Authentication
- Automatic Access Token Renewal
- Refresh Token Rotation
- Token Revocation on Logout
- Secure Token Validation
###Secure Token Storage
- HTTP-Only Cookies
- Secure Cookie Configuration
- Protection against XSS attacks
- Cookie-based Authentication Flow
###Google Authentication
- Google Sign-In using OpenID Connect (OIDC)
- Google Account Registration
- Existing User Login with Google
- Automatic User Registration
- Identity Token Validation
- Application-specific JWT Generation after Google Authentication
π Tech Stack
- Angular
- TypeScript
- Angular HTTP Client
- ASP.NET Core 8 Web API
- Entity Framework Core
- ASP.NET Core Authentication
- JWT Bearer Authentication
- SQL Server
- Entity Framework Core
- Migrations
- ADO.NET Core
###Authentication & Security
- JSON Web Tokens (JWT)
- Refresh Tokens
- HTTP-Only Cookies
- Google OpenID Connect (OIDC)
- OAuth 2.0
Google Authentication Flow
- User clicks Sign in with Google.
- Google authenticates the user using OpenID Connect.
- The backend validates Google's Identity Token.
- If the user is new, an account is automatically created.
- If the user already exists, authentication continues normally.
- The application generates its own JWT Access Token and Refresh Token.
- Tokens are stored securely in HTTP-Only cookies.
π Getting Started
- .NET 8 SDK
- Node.js (LTS)
- Angular CLI
- SQL Server
- Visual Studio 2022
- VS code
π Security Features
- JWT Access Token Authentication
- Refresh Token Rotation
- HTTP-Only Cookie Storage
- Secure Logout
- Token Revocation
- Google OpenID Connect Authentication
- Identity Token Validation
- Automatic Access Token Renewal
- Protection against common client-side token exposure
π€ Contributing
Contributions, suggestions, and feedback are always welcome. Feel free to fork the repository, open an issue, or submit a pull request.
π¨βπ» Author
SURAJ SINGH If you found this project helpful, consider giving it a β on GitHub.