Add Authentication #17
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
[FA-17] Implement Authentication for API Gateway and FileService
Summary
Add authentication to FictionArchive microservices:
Architecture
Tasks
Phase 1: Shared Authentication Infrastructure
Microsoft.AspNetCore.Authentication.JwtBearerpackage toFictionArchive.Service.SharedFictionArchive.Service.Shared/Models/Authentication/OidcConfiguration.csFictionArchive.Service.Shared/Extensions/AuthenticationExtensions.cswithAddOidcAuthentication()andAddFictionArchiveAuthorization()helpersPhase 2: API Gateway Authentication
FictionArchive.API.csprojFictionArchive.API/Program.csto add auth middleware and restrict CORSFictionArchive.API/appsettings.jsonPhase 3: FileService Cookie Authentication
FictionArchive.Service.FileService.csprojFictionArchive.Service.FileService/Program.cswith cookie-based JWT validation (reads fromfa_sessioncookie)[Authorize]attribute toS3ProxyControllerFictionArchive.Service.FileService/appsettings.jsonPhase 4: Frontend Cookie Setting
fictionarchive-web/src/auth/AuthContext.tsxto setfa_sessioncookie after loginPhase 5: Authorization Attributes
[Authorize]attributes to GraphQL resolvers as needed[Authorize(Roles = new[] { "admin" })]) for admin-only operationsConfiguration
docker-compose.ymlfor api-gateway and file-serviceFiles to Modify
FictionArchive.Service.Shared/FictionArchive.Service.Shared.csprojFictionArchive.Service.Shared/Extensions/AuthenticationExtensions.csFictionArchive.Service.Shared/Models/Authentication/OidcConfiguration.csFictionArchive.API/Program.csFictionArchive.API/appsettings.jsonFictionArchive.Service.FileService/Program.csFictionArchive.Service.FileService/Controllers/S3ProxyController.cs[Authorize]FictionArchive.Service.FileService/appsettings.jsonfictionarchive-web/src/auth/AuthContext.tsxdocker-compose.ymlSecurity Notes
secure; samesite=nonerequired for cross-subdomain on HTTPSsamesite=laxwithoutsecure(allows HTTP)@claude can you try handling this issue please?
Claude finished @conco's task —— View job
Authentication System Implementation Complete ✅
I have successfully implemented the authentication system for FictionArchive as outlined in FA-17. All changes have been committed and pushed to the
claude/issue-17-add-authenticationbranch.Completed Tasks:
Key Implementation Details
Authentication Flow:
fa_sessioncookie set on.orfl.xyzdomainfa_sessioncookie for file requestsSecurity Features:
secure; samesite=none; domain=.orfl.xyzsamesite=lax(no secure flag for HTTP localhost)Branch:
claude/issue-17-add-authenticationFiles Modified: 14 files across shared infrastructure, API Gateway, FileService, frontend, and GraphQL resolvers
Next Steps
Please create a pull request from the
claude/issue-17-add-authenticationbranch to merge these authentication changes.