fengling-console/src/Fengling.AuthService
2026-02-02 09:59:32 +08:00
..
bin/Debug feat(auth): pre-register Fengling.Console as OAuth client 2026-02-02 09:59:32 +08:00
Configuration feat(auth): add authentication controller with login endpoint 2026-02-02 01:00:57 +08:00
Controllers feat(auth): add OAuth client management API 2026-02-02 09:58:55 +08:00
Data feat(auth): pre-register Fengling.Console as OAuth client 2026-02-02 09:59:32 +08:00
DTOs feat(auth): add authentication controller with login endpoint 2026-02-02 01:00:57 +08:00
Models feat(auth): add OAuth client management API 2026-02-02 09:58:55 +08:00
obj feat(auth): pre-register Fengling.Console as OAuth client 2026-02-02 09:59:32 +08:00
Properties feat(auth): create authentication service project structure 2026-02-01 23:23:56 +08:00
.dockerignore feat(auth): add Dockerfile for containerization 2026-02-02 09:55:10 +08:00
appsettings.Development.json feat(auth): create authentication service project structure 2026-02-01 23:23:56 +08:00
appsettings.json feat(auth): create authentication service project structure 2026-02-01 23:23:56 +08:00
Dockerfile feat(auth): add Dockerfile for containerization 2026-02-02 09:55:10 +08:00
Fengling.AuthService.csproj feat(auth): add health check endpoint 2026-02-02 09:54:36 +08:00
Fengling.AuthService.http feat(auth): create authentication service project structure 2026-02-01 23:23:56 +08:00
Program.cs feat(auth): add health check endpoint 2026-02-02 09:54:36 +08:00
README.md docs(auth): add API documentation 2026-02-02 09:55:23 +08:00

Fengling Auth Service

Authentication and authorization service using OpenIddict.

Features

  • JWT token issuance
  • OAuth2/OIDC support
  • Multi-tenant support (TenantId in JWT claims)
  • Role-based access control (RBAC)
  • Health check endpoint

API Endpoints

Get Token

POST /connect/token
Content-Type: application/x-www-form-urlencoded

grant_type=password
username={username}
password={password}
scope=api offline_access

Health Check

GET /health

Default Users

  • Admin: username=admin, password=Admin@123, role=Admin
  • Test User: username=testuser, password=Test@123, role=User

Running Locally

dotnet run

Service runs on port 5000.

Docker

docker build -t fengling-auth:latest .
docker run -p 5000:80 fengling-auth:latest

Environment Variables

  • ConnectionStrings__DefaultConnection: PostgreSQL connection string
  • OpenIddict__Issuer: Token issuer URL
  • OpenIddict__Audience: Token audience

Database

  • PostgreSQL
  • Uses ASP.NET Core Identity for user/role management
  • Tenant isolation via TenantId column