Skip to content

Add caching for JWK client #178

@rodrigobr-msft

Description

@rodrigobr-msft

Currently, each call to the jwt_authorization_middleware instantiates a new JwtTokenValidator, so we cannot persist the PyJWKClient objects used, which means that the provided caching utility for that class is not leveraged.

Thus, we make an unnecessary extra request to https://login.botframework.com/v1/.well-known/keys or https://login.microsoftonline.com/{self.configuration.TENANT_ID}/discovery/v2.0/keys on every validation of the incoming JWT when we could just use a cached value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions