Skip to content

Incorrect calculation of refreshing time OpenIDMetadata #990

@thundra

Description

@thundra

Version

I am using botframework-connector==4.8.0

Description

We should update open id metadata once every five days. In the line https://github.com/microsoft/botbuilder-python/blob/master/libraries/botframework-connector/botframework/connector/auth/jwt_token_extractor.py#L129

        if self.last_updated < (datetime.now() + timedelta(days=5)):
            await self._refresh()

we can see that refreshing will be performed every time as self.last_updated will be always less then now + 5 days.

In order to fix this issue, we should change + to -. In that case, metadata will be refreshed once every 5 days.

For refreshing metadata, two additional requests are performed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions