Skip to content

feat: add JWT authentication for gRPC requests#18

Merged
ashtonjordan merged 3 commits into
webex:mainfrom
adamweeks:jwt-validation
Dec 5, 2025
Merged

feat: add JWT authentication for gRPC requests#18
ashtonjordan merged 3 commits into
webex:mainfrom
adamweeks:jwt-validation

Conversation

@adamweeks
Copy link
Copy Markdown
Collaborator

  • Implement JWT validation for securing gRPC communication with Webex Contact Center.
  • Introduce JWTAuthInterceptor for token validation in gRPC requests.
  • Update configuration to include JWT settings in config.yaml.
  • Enhance README with detailed JWT authentication instructions and deployment recommendations.
  • Add unit tests for JWT validation and interceptor functionality.
  • Update requirements.txt to include cryptography support for JWT signature verification.

- Implement JWT validation for securing gRPC communication with Webex Contact Center.
- Introduce JWTAuthInterceptor for token validation in gRPC requests.
- Update configuration to include JWT settings in config.yaml.
- Enhance README with detailed JWT authentication instructions and deployment recommendations.
- Add unit tests for JWT validation and interceptor functionality.
- Update requirements.txt to include cryptography support for JWT signature verification.
…ions

- Clarify that the `datasource_url` must match exactly with the registered URL in BYoDS API.
- Add examples for different URL formats and common mistakes to avoid.
- Include verification steps and debugging tips for datasource URL mismatch errors.
Copy link
Copy Markdown
Collaborator

@ashtonjordan ashtonjordan left a comment

Choose a reason for hiding this comment

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

Overall everything works, and looks good. And in regards to porting the code from the simulator repo. Might be a good idea to open a PR with them to fix their logic.

Context: This JWT validation code was imported/adapted from a Java repository implementation.

Root Cause: The security vulnerabilities (Issues 1-2) exist in the original Java source code and were carried over during the Python port.

Recommendations:

  1. Fix upstream first: Create a pull request in the original Java repository to implement issuer validation and remove unused constants

Comment thread src/auth/jwt_validator.py
Comment thread src/auth/jwt_validator.py Outdated
Comment thread main.py
…ents

- Add validation for JWT token issuer to prevent SSRF attacks by rejecting invalid issuers before fetching keys.
- Update README with detailed instructions on valid issuers for Webex identity brokers.
- Modify configuration to include a specific datasource URL.
- Enhance unit tests to ensure invalid issuers are handled correctly and do not trigger key fetching.
@adamweeks
Copy link
Copy Markdown
Collaborator Author

Pull request on the java repo opened for security issue as requested by @ashjorda: CiscoDevNet/webex-contact-center-provider-sample-code#24

@adamweeks
Copy link
Copy Markdown
Collaborator Author

@ashjorda changes requested regarding security have been implemented, good finds! Ready for another round

Copy link
Copy Markdown
Collaborator

@ashtonjordan ashtonjordan left a comment

Choose a reason for hiding this comment

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

LGTM!

@ashtonjordan ashtonjordan merged commit ccfbd25 into webex:main Dec 5, 2025
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