in azure-active-directory-server/src/main/kotlin/org/jetbrains/teamcity/aad/JWTVerifier.kt [33:44]
fun verify(jwtString: String): JwtClaims {
val httpsJwksKeyResolver = HttpsJwksVerificationKeyResolver(getHttpsJwks())
val jwtConsumer = JwtConsumerBuilder()
.setRequireExpirationTime() // the JWT must have an expiration time
.setAllowedClockSkewInSeconds(3600) // allow some leeway in validating time based claims to account for clock skew
.setRequireSubject() // the JWT must have a subject claim
.setSkipDefaultAudienceValidation()
.setVerificationKeyResolver(httpsJwksKeyResolver)
.build()
return jwtConsumer.processToClaims(jwtString)
}