Skip to content

Conversation

erquirogasw
Copy link
Contributor

Fixes #6563

Description

This PR catches the SecurityTokenExpiredException when a JWT token is expired.

Specific Changes

  • Added catch block on the ValidateTokenAsync method of the JwtTokenExtractor class.
  • Added unit test for the JwtTokenExtractor class.
  • Added unit test for the CloudAdapter class.

Testing

These images show the new unit tests passing.
image

@erquirogasw erquirogasw requested a review from a team as a code owner December 15, 2022 19:38
@ceciliaavila ceciliaavila added the Automation: Parity with js The PR needs to be ported to JS label Dec 15, 2022
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 333699

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 7 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.07%) to 79.128%

Files with Coverage Reduction New Missed Lines %
/libraries/AdaptiveExpressions/BuiltinFunctions/GetNextViableTime.cs 1 90.91%
/libraries/AdaptiveExpressions/BuiltinFunctions/GetPreviousViableTime.cs 1 90.91%
/libraries/integration/Microsoft.Bot.Builder.Integration.AspNet.Core/ServiceCollectionExtensions.cs 1 93.55%
/libraries/Microsoft.Bot.Connector/Authentication/JwtTokenExtractor.cs 4 54.81%
Totals Coverage Status
Change from base Build 332211: 0.07%
Covered Lines: 25742
Relevant Lines: 32532

💛 - Coveralls

@BruceHaley
Copy link
Contributor

✔️ No Binary Compatibility issues for Microsoft.Bot.Connector.dll

@tracyboehrer tracyboehrer merged commit 397aa48 into main Jan 17, 2023
@tracyboehrer tracyboehrer deleted the southworks/test/SecurityTokenExpiredException branch January 17, 2023 16:13
tracyboehrer pushed a commit that referenced this pull request Jan 17, 2023
* Add UnauthorizedAccessException when the SecurityTokenExpiredException is thrown

* Add CloudAdapter test

Co-authored-by: sw-joelmut <[email protected]>
tracyboehrer added a commit that referenced this pull request Jan 17, 2023
* Fix cast issue in SendHandoffActivity action. (#6575)

* [#6563] Expired JWT token exception not being handled (#6572)

* Add UnauthorizedAccessException when the SecurityTokenExpiredException is thrown

* Add CloudAdapter test

Co-authored-by: sw-joelmut <[email protected]>

Co-authored-by: Cecilia Avila <[email protected]>
Co-authored-by: erquirogasw <[email protected]>
Co-authored-by: sw-joelmut <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Automation: Parity with js The PR needs to be ported to JS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expired JWT token exception not being handled

6 participants