# Deprecated Components - Ladaer-Backend

## LadaIdentity Project - DEPRECATED

### Status
- **Current Status**: No longer used
- **Deprecation Date**: Recent migration
- **Replacement**: Built-in ASP.NET Core Identity in Ladaer.BackEnd

### Previous Configuration
- **Project Type**: ASP.NET Core Web Application
- **Framework**: IdentityServer4
- **Port**: https://localhost:7014
- **Purpose**: Centralized authentication and authorization server

### Previous Features
- IdentityServer4 implementation
- User authentication
- JWT token generation and validation
- Role-based authorization
- OAuth2/OpenID Connect support
- Centralized user management

### Migration Details

#### What Changed
1. **Authentication moved to main API**: Authentication logic integrated into Ladaer.BackEnd
2. **IdentityServer4 replaced**: Now using built-in ASP.NET Core Identity
3. **JWT tokens**: Still used but generated by main API instead of separate identity server
4. **User management**: Moved to main API controllers and services

#### Benefits of Migration
- **Simplified architecture**: Reduced number of services to maintain
- **Better integration**: Authentication tightly integrated with business logic
- **Easier deployment**: One less service to deploy and configure
- **Reduced complexity**: No need for cross-service authentication flows

#### Technical Changes
- **Authentication endpoint**: Now part of main API at https://localhost:7284
- **Token generation**: Handled by ASP.NET Core Identity in main API
- **User management**: UserController in main API handles all user operations
- **Role management**: RoleController in main API manages roles and permissions

### Code References to Update
If you encounter references to LadaIdentity in the codebase:

#### Configuration Files
- Remove LadaIdentity from solution file references
- Update authentication URLs from localhost:7014 to localhost:7284
- Remove IdentityServer4 client configurations

#### API Calls
- Update authentication endpoints to point to main API
- Change token validation to use main API endpoints
- Update user management API calls

#### Documentation
- Update API documentation to reflect new authentication endpoints
- Remove references to separate identity server
- Update deployment guides

### Current Authentication Architecture

#### Main API Authentication
- **Endpoint**: https://localhost:7284/api/auth/*
- **Technology**: ASP.NET Core Identity + JWT
- **User Management**: Integrated with main business logic
- **Role Management**: Dynamic configuration via database

#### Authentication Flow
1. User login via main API
2. JWT token generated by main API
3. Token used for subsequent API calls
4. Role-based authorization handled by main API

### Migration Checklist
- [x] Remove LadaIdentity project from solution
- [x] Update authentication to use ASP.NET Core Identity
- [x] Move user management to main API
- [x] Update documentation and configuration
- [ ] Remove any remaining references in client applications
- [ ] Update deployment scripts
- [ ] Update environment configurations

### Notes for Developers
- When working with authentication, use the main API endpoints
- User and role management is now part of the main business logic
- JWT tokens are still used but generated by the main API
- All authentication-related code is in Ladaer.BackEnd project
- No need to run separate identity server for development

### Related Files to Check
- `Ladaer.BackEnd/Controllers/AuthController.cs` (if exists)
- `Ladaer.BackEnd/Controllers/UserController.cs`
- `Ladaer.BackEnd/Controllers/RoleController.cs`
- `Ladaer.BackEnd/Infrastructures/Services/Auth/*`
- `appsettings.json` authentication configuration
- Client application authentication configurations
