Commit Graph

24 Commits

Author SHA1 Message Date
74f8221be4 🐛 Fix Spotify OIDC 2025-11-02 16:00:02 +08:00
6817ab6b56 Spotify OAuth & Presence 2025-11-02 15:32:20 +08:00
c74ab20236 ♻️ Refactor OpenID: Phase 4: Advanced Architecture - Strategy Pattern Implementation
- Added comprehensive user info strategy pattern with IUserInfoStrategy interface
- Created IdTokenValidationStrategy for Google/Apple ID token validation and parsing
- Implemented UserInfoEndpointStrategy for Microsoft/Discord/GitHub OAuth user data retrieval
- Added DirectTokenResponseStrategy placeholder for Afdian and similar providers
- Updated GoogleOidcService to use IdTokenValidationStrategy instead of custom callback logic
- Centralized JWT token validation, claim extraction, and user data parsing logic
- Eliminated code duplication across providers while maintaining provider-specific behavior
- Improved maintainability by separating concerns of user data retrieval methods
- Set architectural foundation for easily adding new OIDC providers by implementing appropriate strategies
2025-11-02 15:05:42 +08:00
b9edf51f05 ♻️ Refactor OpenID: Phase 3: Async Flow Modernization
- Added async GetAuthorizationUrlAsync() methods to all OIDC providers
- Updated base OidcService with abstract async contract and backward-compatible sync wrapper
- Modified OidcController to use async authorization URL generation
- Removed sync blocks using .GetAwaiter().GetResult() in Google provider
- Maintained backward compatibility with existing sync method calls
- Eliminated thread blocking and improved async flow throughout auth pipeline
- Enhanced scalability by allowing non-blocking async authorization URL generation
2025-11-02 15:05:38 +08:00
74a9ca98ad ♻️ Refactor OpenID: Phase 2: Security Hardening - PKCE Implementation
- Added GenerateCodeVerifier() and GenerateCodeChallenge() methods to base OidcService
- Implemented PKCE (Proof Key for Code Exchange) for Google OAuth flow:
  * Generate cryptographically secure code verifier (256-bit random)
  * Create SHA-256 code challenge for authorization request
  * Cache code verifier with 15-minute expiration for token exchange
  * Validate and remove code verifier during callback to prevent replay attacks
- Enhances security by protecting against authorization code interception attacks
- Uses S256 (SHA-256) code challenge method as per RFC 7636
2025-11-02 15:05:19 +08:00
4bd59f107b ♻️ Refactor OpenID: Phase 1: Code Consolidation optimizations
- Add BuildAuthorizationParameters() method to reduce authorization URL duplication
- Update GoogleOidcService to use common parameter building method
- Add missing using statements for AppDatabase and AuthService namespaces
- Improve code reusability and eliminate 20+ lines of repeated authorization logic per provider
2025-11-02 15:05:04 +08:00
c64adace24 💄 Using remote site instead of embed frontend (removed) to handle oidc redirect 2025-10-06 13:05:50 +08:00
8ac0b28c66 🚚 Move callback to under api 2025-10-06 13:01:15 +08:00
8f71d7f9e5 🐛 Fix some bugs 2025-10-06 12:46:25 +08:00
9ce31c4dd8 ♻️ Finish centerlizing the data models 2025-09-27 15:14:05 +08:00
e70d8371f8 ♻️ Centralized data models (wip) 2025-09-27 14:09:28 +08:00
52430c19a5 🐛 Enable JsonNumberHandling.AllowNamedFloatingPointLiterals global wide 2025-09-07 14:39:25 +08:00
d7271a2d11 🐛 Fix odic stuff 2025-09-02 00:33:47 +08:00
1778ab112d Authorized device 2025-08-14 02:21:59 +08:00
5f70d53c94 New authorized device 2025-08-14 02:10:32 +08:00
f8d8e485f1 ♻️ Refactored the authorized device (now client) 2025-08-13 15:27:31 +08:00
76fdf14e79 ♻️ Refactored authorize device system (wip) (skip ci) 2025-08-13 02:04:26 +08:00
192ea0fcdd 🐛 Fix discord oidc 2025-08-03 13:10:15 +08:00
189abd4982 🐛 Fix afdian oidc 2025-08-03 12:56:45 +08:00
e689d15688 💄 Optimize webpage connections experience 2025-08-03 12:29:12 +08:00
081f3f609e File pool instead of destination configuration 2025-07-26 00:41:47 +08:00
da5b3ac261 🐛 Dozens of bug fixes 2025-07-19 16:41:04 +08:00
ba49d1c7a7 ♻️ Basically completed the separate of account service 2025-07-12 11:40:18 +08:00
e76c80eead ♻️ Moved some services to DysonNetwork.Pass 2025-07-11 02:00:40 +08:00