Skip to content

Conversation

shams858
Copy link
Contributor

@shams858 shams858 commented Aug 21, 2025

Title: Add OAuth 2.0 Authentication Support in Edit Gateway

Description:
This PR implements OAuth 2.0 authentication support for editing gateways in the MCP Gateway admin interface.

Changes Made

Frontend Updates

  • Edit Gateway Modal: Added OAuth 2.0 option to Authentication Type dropdown
  • OAuth Form Fields: Implemented complete OAuth 2.0 configuration form including:
    • Grant Type selection (Client Credentials vs Authorization Code)
    • Client ID and Client Secret fields
    • Token URL configuration
    • Authorization Code specific fields (Authorization URL, Redirect URI, Scopes)
    • Dynamic field visibility based on grant type selection
  • JavaScript Handlers: Added OAuth field population, validation, and form submission handling
  • Security: Client secrets are never populated in edit forms for security

Backend Updates

  • Schema Enhancement: Added oauth_config field to GatewayUpdate schema
  • Admin API: Updated admin_edit_gateway endpoint to handle OAuth configuration
  • Gateway Service: Enhanced update_gateway method to process OAuth updates
  • Encryption: Integrated OAuth client secret encryption for secure storage

Security Features

  • Client secrets are encrypted before database storage
  • Client secrets are never returned in API responses
  • Edit forms show empty secret fields (users must re-enter to change)
  • Proper validation and sanitization of OAuth configuration data

Related Issues

Related to this #782

Screenshots

image

@shams858 shams858 requested a review from crivetimihai as a code owner August 21, 2025 04:54
Shamsul Arefin added 2 commits August 21, 2025 09:25
@crivetimihai crivetimihai force-pushed the feature-oauth-support-in-edit-gateway branch from 4bfad78 to 71411d3 Compare August 21, 2025 08:27
@crivetimihai
Copy link
Member

crivetimihai commented Aug 21, 2025

Awesome, thank you. Reviewing and rebase it, please don't push for now, merge in progress!

Copy link
Member

@crivetimihai crivetimihai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready to merge!

@crivetimihai
Copy link
Member

Awesome, thank you!

@crivetimihai crivetimihai merged commit d0e9cc0 into IBM:main Aug 21, 2025
36 checks passed
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