Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsonWebTokenHandler to return the JsonWebToken on validation failure #1989

Merged
merged 5 commits into from
Jan 18, 2023

Conversation

dannybtsai
Copy link
Contributor

When a validation fails, the JsonWebTokenHandler should return the JsonWebToken so the caller can check the claims and log details if needed.

…meters.IncludeTokenOnFailedValidation is set
@sruke
Copy link
Contributor

sruke commented Jan 3, 2023

Consider adding documentation to PR or release notes detailing which TokenValidationParameter to set and how to retrieve the token on validation failiure.

@sruke
Copy link
Contributor

sruke commented Jan 4, 2023

TokenValidationParameterTests and TokenValidationResultTests tests are failing. Please review the failures and update the tests.

build.ps1 Outdated Show resolved Hide resolved
…meters.IncludeTokenOnFailedValidation is set
Copy link
Contributor

@sruke sruke left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -1,7 +1,7 @@
<!-- This file may be overwritten by automation. Only values allowed here are VersionPrefix and VersionSuffix. -->
<Project>
<PropertyGroup>
<VersionPrefix>0.0.1</VersionPrefix>
Copy link
Contributor

Choose a reason for hiding this comment

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

@dannybtsai, did you accidentally check-in this file?

@@ -2,8 +2,8 @@
<dotnetArchitecture>x64</dotnetArchitecture>
<nugetVersion>3.5.0-rc-1285</nugetVersion>
<runtimes>net45,net461,netstandard2.0</runtimes>
<assemblyVersion>6.25.2</assemblyVersion>
<nugetSuffix>preview</nugetSuffix>
Copy link
Contributor

Choose a reason for hiding this comment

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

@dannybtsai, did you accidentally check-in this file?

build.ps1 Outdated
@@ -1,7 +1,7 @@
param(
[string]$buildType="Debug",
[string]$dotnetDir="c:\Program Files\dotnet",
[string]$msbuildDir="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin",
Copy link
Contributor

Choose a reason for hiding this comment

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

@dannybtsai, did you accidentally check-in this file?

@@ -22,8 +22,8 @@ public void Publics()
TokenValidationParameters validationParameters = new TokenValidationParameters();
Type type = typeof(TokenValidationParameters);
PropertyInfo[] properties = type.GetProperties();
if (properties.Length != 56)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we define a constant instead of hard-coding it?

@dannybtsai dannybtsai merged commit 2d18df9 into dev Jan 18, 2023
renovate bot added a commit to orso-co/Orso.Arpa.Api that referenced this pull request Jan 24, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[System.IdentityModel.Tokens.Jwt](https://togithub.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet)
| nuget | minor | `6.25.1` -> `6.26.0` |

---

### Release Notes

<details>

<summary>AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet</summary>

###
[`v6.26.0`](https://togithub.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/releases/tag/6.26.0)

[Compare
Source](https://togithub.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/compare/6.25.1...6.26.0)

Servicing release
Introducing a new boolean TokenValidationParameter LogTokenId.

[AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#2002
Update System.Text.Encodings.Web

[AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#1997
Update ValidateToken call stack fully async

[AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#1996
JsonWebTokenHandler to return the JsonWebToken on validation failure

[AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#1989
Update documentation of DefaultTokenLifetimeInMinutes

[AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#1988

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 10pm every weekday,every
weekend,before 5am every weekday" in timezone Europe/Berlin, Automerge -
At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/orso-co/Orso.Arpa.Api).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMDkuMSIsInVwZGF0ZWRJblZlciI6IjM0LjEwOS4xIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@brentschmaltz brentschmaltz deleted the danny/ReturnJwtOnFailure-dev branch June 2, 2023 21:51
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.

None yet

4 participants