Fix for private jwt client to rebuild when expired#221
Merged
SomkaPe merged 1 commit intoAzureAD:devfrom May 5, 2020
Merged
Conversation
The PrivateJwt assertion with a certificate is generated once This means that when a request for a new OAuth Token is made that the client assertion has expired and fails. This change fixes that by reubuilding the assersion for a private jwt when it has expired
sangonzal
reviewed
May 4, 2020
Contributor
There was a problem hiding this comment.
@Budlee Thanks for the contribution and cleaning up the code in a couple of places! looks good to me. @SomkaPe @Avery-Dunn thoughts?
| final Date currentDateTime = new Date(System.currentTimeMillis()); | ||
| final Date expirationTime = ((PrivateKeyJWT) clientAuthentication).getJWTAuthenticationClaimsSet().getExpirationTime(); | ||
| if (expirationTime.before(currentDateTime)) { | ||
| //The asserted private jwt with the client certificate can expire so rebuild it when the |
Contributor
There was a problem hiding this comment.
Comment is missing a couple of words.
| } | ||
|
|
||
| @Test | ||
| public void testClientCertificateRebuildsWhenExpired() throws Exception { |
Contributor
There was a problem hiding this comment.
Expiration is misspelled in a couple of places.
SomkaPe
approved these changes
May 5, 2020
SomkaPe
pushed a commit
that referenced
this pull request
May 5, 2020
The PrivateJwt assertion with a certificate is generated once This means that when a request for a new OAuth Token is made that the client assertion has expired and fails. This change fixes that by reubuilding the assersion for a private jwt when it has expired
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The PrivateJwt assertion with a certificate is generated once
This means that when a request for a new OAuth Token is made that
the client assertion has expired and fails. This change
fixes that by reubuilding the assersion for a private jwt when
it has expired