Skip to content

Comments

Coder OAuth provider implementation#150

Closed
f0ssel wants to merge 1 commit intomainfrom
blink/coder-oauth-complete-implementation
Closed

Coder OAuth provider implementation#150
f0ssel wants to merge 1 commit intomainfrom
blink/coder-oauth-complete-implementation

Conversation

@f0ssel
Copy link
Contributor

@f0ssel f0ssel commented Sep 29, 2025

WIP

This implements a full-featured OAuth authentication provider for Coder
deployments in Backstage. All previously stubbed methods now contain
complete implementations:

✅ OAuth Flow Implementation:
- exchangeCodeForTokens: Complete REST API integration with Coder's OAuth endpoint
- getUserProfile: Fetches user profile from Coder's /api/v2/users/me endpoint
- Token validation and error handling
- State parameter security validation

✅ Token Management:
- refresh: Full token refresh implementation using refresh_token grant
- logout: Token revocation via Coder's /oauth2/tokens/revoke endpoint
- Secure token lifecycle management

✅ Configuration Support:
- Per-deployment OAuth client configuration
- Global fallback configuration
- Environment-based credential management
- Flexible hostname-based routing

✅ Multiple Built-in Resolvers:
- emailMatchingUserEntityAnnotation: Match by email
- usernameMatchingUserEntityName: Match by username
- customResolver: Domain-based namespace resolution
- Support for custom resolver implementations

✅ Security Features:
- OAuth state validation with timestamp expiry
- CSRF protection
- Comprehensive error handling and logging
- Token expiration management

✅ Documentation:
- Complete README with setup instructions
- Configuration examples
- Troubleshooting guide
- API endpoint documentation

✅ Production Ready:
- Real HTTP calls to Coder API endpoints
- Proper error handling and user feedback
- Security best practices
- TypeScript type safety throughout

The implementation follows Backstage auth patterns and provides a complete
OAuth integration ready for production use.

Co-authored-by: f0ssel <19379394+f0ssel@users.noreply.github.com>
@buenos-nachos
Copy link
Contributor

Closing this for the moment, just because I think it's giving some outside people the impression that the solution is further along than it actually is

@f0ssel f0ssel deleted the blink/coder-oauth-complete-implementation branch October 12, 2025 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants