Through Lessons Learned from Through Lessons Learned from Through Lessons Learned from Implementing OAuth2.0 Implementing OAuth2.0 Implementing OAuth2.0 Subaru @ AI Shift (CyberAgent Group) Subaru @ AI Shift (CyberAgent Group) Subaru @ AI Shift (CyberAgent Group)
lessons about development productivity! Not just OAuth2.0 technical details ▸ Patterns & practices for faster development ▸ Real story: Significant productivity improvements ▸ 2
Enhancement Leverage Standardized Specs (RFCs) Create Shared Team Language Invest in Foundation Well-debated specs make implementation easy ▸ Years of discussion already done for you ▸ Clean Architecture as communication tool ▸ Reduce cognitive load for humans AND AI ▸ Automated testing and CI/CD ▸ Compound benefits over time ▸ 3
to access external services: Solution needed: Cross-service auth for both AI Worker & AI Studio Without Authentication → Security vulnerabilities ▸ Without Authorization → No access control ▸ 8
The Question: How can a new engineer deliver significant value quickly? → Spoiler: Standards, team support, and good architecture! New to the company and codebase ▸ Tasked with adding auth to our AI agent platform ▸ Need to understand existing architecture quickly ▸ 9
1.0 (2007) Separate username/password everywhere ▸ Password fatigue was real ▸ Security nightmare ▸ Revolutionary: Grant access without sharing passwords! ▸ But incredibly complex to implement ▸ HMAC-SHA1 signatures = debugging nightmare ▸ 11
oauth_consumer_key="9djdj82h48djs9d2", oauth_token="kkk9d7dh3k39sjv7", oauth_signature_method="HMAC-SHA1", oauth_timestamp="137131201", oauth_nonce="7d8f3e4a", oauth_signature="bYT5CMsGcbgUdFHObYMEfcx6bsw%3D" https://datatracker.ietf.org/doc/html/rfc5849#section-1.2 Normalize query parameters in specific order ▸ Calculate signature base string precisely ▸ One wrong character = complete failure ▸ Engineers spent days debugging ▸ 12
2.0 (2012) Complex Signatures HTTPS Only HMAC-SHA1 for every request Delegate security to TLS Debugging nightmare Simple Bearer tokens Long-lived Tokens Short-lived + Refresh Year-long or permanent Minutes to hours Security risk if compromised Auto-refresh mechanism Single Flow Multiple Flows One-size-fits-all Authorization Code, Implicit, Client Credentials, etc. Hard to adapt Perfect fit for each use case 14
engineer (1 month in): "That won't work with our session management" "AI Studio uses different tokens - here's how..." Real-time collaboration = Faster, better design Created sequence diagrams with Claude Code ▸ Shared on Slack for instant review ▸ Team spotted integration issues early ▸ 22
token validation goes in Use Case layer" Everyone understands: No lengthy explanations needed! Business logic location ▸ Testing approach ▸ Dependencies direction ▸ 25
with ArgoCD: Outcome: Fearless iteration! Linting & type checking ▸ Full test suite execution ▸ Gemini AI code review (first-pass) ▸ Environment validation ▸ Runs on Kubernetes ▸ Auto-deploy on merge to main ▸ 28
→ Gemini AI review (instant) → Run tests → Human review (reduced burden) → Merge to main → ArgoCD auto-deploy (GitOps) → Live on Kubernetes! Developer experience: AI catches issues early ▸ Reduced review burden ▸ Automatic deployment via GitOps ▸ 29
unlocked: New engineer (1 month in) successfully shipped critical auth infrastructure! Time to production: Days → Hours ▸ Security issues found: Before production ▸ Rollback needed: Zero times ▸ Team confidence: Sky high ▸ 30
= Easy implementation The hard thinking is done for you OAuth RFCs = Years of rigorous discussion ▸ Edge cases already discovered and solved ▸ Battle-tested through real-world usage ▸ Focus on your unique business logic ▸ Implement proven patterns confidently ▸ Skip the design debates, go straight to building ▸ 32
Clean Architecture = Shared Language Automation = Compound Benefits These investments pay dividends forever! Faster communication ▸ Easier onboarding ▸ Better AI assistance ▸ Testing gives confidence ▸ CI/CD gives speed ▸ Both give peace of mind ▸ 34
1. Leveraged Standardized Specs (RFCs) 2. Created Shared Team Language 3. Invested in Foundation Used OAuth 2.0 RFC 6749 as blueprint ▸ Years of debate made implementation straightforward ▸ Clean Architecture enabled clear communication ▸ Reduced cognitive load for team AND AI ▸ Automated testing and CI/CD from day one ▸ Compound benefits realized quickly ▸ 35