library/src/main/java/org/apache/fineract/cn/anubis/security/FinKeycloakAuthenticationProvider.java [152:180]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        throw AmitAuthenticationException.invalidTokenKeyTimestamp(tokenType.getIssuer(), keyTimestamp);
                    }
                }

                @Override public Key resolveSigningKey(final JwsHeader header, final String plaintext) {
                    return null;
                }
            }).parse(token);

            final String alg = jwt.getHeader().get("alg").toString();
            final SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.forName(alg);
            if (!signatureAlgorithm.isRsa()) {
                logger.debug("Authentication failed because the token is signed with an algorithm other than RSA.");
                throw AmitAuthenticationException.invalidTokenAlgorithm(alg);
            }

            final String keyTimestamp = getKeyTimestampFromClaims(jwt.getBody());
            final TokenType tokenType = getTokenTypeFromClaims(jwt.getBody());

            return new TokenInfo(tokenType, keyTimestamp);
        }
        catch (final JwtException e)
        {
            logger.debug("Authentication failed because token parsing failed.");
            throw AmitAuthenticationException.invalidToken();
        }
    }

    private @Nonnull String getKeyTimestampFromClaims(final Claims claims) {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



library/src/main/java/org/apache/fineract/cn/anubis/security/IsisAuthenticatedAuthenticationProvider.java [152:180]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            throw AmitAuthenticationException.invalidTokenKeyTimestamp(tokenType.getIssuer(), keyTimestamp);
          }
        }

        @Override public Key resolveSigningKey(final JwsHeader header, final String plaintext) {
          return null;
        }
      }).parse(token);

      final String alg = jwt.getHeader().get("alg").toString();
      final SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.forName(alg);
      if (!signatureAlgorithm.isRsa()) {
        logger.debug("Authentication failed because the token is signed with an algorithm other than RSA.");
        throw AmitAuthenticationException.invalidTokenAlgorithm(alg);
      }

      final String keyTimestamp = getKeyTimestampFromClaims(jwt.getBody());
      final TokenType tokenType = getTokenTypeFromClaims(jwt.getBody());

      return new TokenInfo(tokenType, keyTimestamp);
    }
    catch (final JwtException e)
    {
      logger.debug("Authentication failed because token parsing failed.");
      throw AmitAuthenticationException.invalidToken();
    }
  }

  private @Nonnull String getKeyTimestampFromClaims(final Claims claims) {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



