@@ -334,13 +334,13 @@ public boolean validateGrant(OAuthTokenReqMessageContext tokReqMsgCtx) throws Id
334
334
//check whether this jwt was issued by the resident identity provider
335
335
identityProvider = getResidentIDPForIssuer (tenantDomain , jwtIssuer );
336
336
if (identityProvider == null ) {
337
- handleClientException ("No Registered IDP found for the JWT with issuer name : " + jwtIssuer );
337
+ handleClientException ("No registered identity provider found for the JWT with issuer name : " + jwtIssuer );
338
338
}
339
339
}
340
340
341
341
tokenEndPointAlias = getTokenEndpointAlias (identityProvider );
342
342
} else {
343
- handleClientException ("No Registered IDP found for the JWT with issuer name : " + jwtIssuer );
343
+ handleClientException ("No registered identity provider found for the JWT with issuer name : " + jwtIssuer );
344
344
}
345
345
if (signedJWT != null ) {
346
346
signatureValid = validateSignature (signedJWT , identityProvider );
@@ -689,10 +689,13 @@ private boolean checkExpirationTime(Date expirationTime, long currentTimeInMilli
689
689
690
690
long expirationTimeInMillis = expirationTime .getTime ();
691
691
if ((currentTimeInMillis + timeStampSkewMillis ) > expirationTimeInMillis ) {
692
- handleClientException ("JSON Web Token is expired." +
693
- ", Expiration Time(ms) : " + expirationTimeInMillis +
694
- ", TimeStamp Skew : " + timeStampSkewMillis +
695
- ", Current Time : " + currentTimeInMillis + ". JWT Rejected and validation terminated" );
692
+ if (log .isDebugEnabled ()) {
693
+ log .debug ("JSON Web Token is expired." +
694
+ ", Expiration Time(ms) : " + expirationTimeInMillis +
695
+ ", TimeStamp Skew : " + timeStampSkewMillis +
696
+ ", Current Time : " + currentTimeInMillis + ". JWT Rejected and validation terminated" );
697
+ }
698
+ handleClientException ("JSON Web Token is expired." );
696
699
}
697
700
return true ;
698
701
}
@@ -710,10 +713,13 @@ private boolean checkNotBeforeTime(Date notBeforeTime, long currentTimeInMillis,
710
713
711
714
long notBeforeTimeMillis = notBeforeTime .getTime ();
712
715
if (currentTimeInMillis + timeStampSkewMillis < notBeforeTimeMillis ) {
713
- handleClientException ("JSON Web Token is used before Not_Before_Time." +
714
- ", Not Before Time(ms) : " + notBeforeTimeMillis +
715
- ", TimeStamp Skew : " + timeStampSkewMillis +
716
- ", Current Time : " + currentTimeInMillis + ". JWT Rejected and validation terminated" );
716
+ if (log .isDebugEnabled ()) {
717
+ log .debug ("JSON Web Token is used before Not_Before_Time." +
718
+ ", Not Before Time(ms) : " + notBeforeTimeMillis +
719
+ ", TimeStamp Skew : " + timeStampSkewMillis +
720
+ ", Current Time : " + currentTimeInMillis + ". JWT Rejected and validation terminated" );
721
+ }
722
+ handleClientException ("JSON Web Token is used before Not_Before_Time." );
717
723
}
718
724
return true ;
719
725
}
@@ -734,11 +740,14 @@ private boolean checkValidityOfTheToken(Date issuedAtTime, long currentTimeInMil
734
740
long rejectBeforeMillis = 1000L * 60 * validityPeriod ;
735
741
if (currentTimeInMillis + timeStampSkewMillis - issuedAtTimeMillis >
736
742
rejectBeforeMillis ) {
737
- handleClientException ("JSON Web Token is issued before the allowed time." +
738
- ", Issued At Time(ms) : " + issuedAtTimeMillis +
739
- ", Reject before limit(ms) : " + rejectBeforeMillis +
740
- ", TimeStamp Skew : " + timeStampSkewMillis +
741
- ", Current Time : " + currentTimeInMillis + ". JWT Rejected and validation terminated" );
743
+ if (log .isDebugEnabled ()) {
744
+ log .debug ("JSON Web Token is issued before the allowed time." +
745
+ ", Issued At Time(ms) : " + issuedAtTimeMillis +
746
+ ", Reject before limit(ms) : " + rejectBeforeMillis +
747
+ ", TimeStamp Skew : " + timeStampSkewMillis +
748
+ ", Current Time : " + currentTimeInMillis + ". JWT Rejected and validation terminated" );
749
+ }
750
+ handleClientException ("JSON Web Token is issued before the allowed time." );
742
751
}
743
752
return true ;
744
753
}
0 commit comments