public static Boolean verifyJWT(final String jwt,final String secret) throws HmacException {
  try {
    SignedJWT signedJWT=SignedJWT.parse(jwt);
    JWSVerifier jwsVerifier=new MACVerifier(secret);
    return signedJWT.verify(jwsVerifier);
  }
 catch (  ParseException|JOSEException ex) {
    throw new HmacException("Cannot verify JWT",ex);
  }
}

public static Boolean verifyJWT ( final String jwt , final String secret ) throws HmacException { try { SignedJWT signedJWT = SignedJWT . parse ( jwt ) ; JWSVerifier jwsVerifier = new MACVerifier ( secret ) ; return signedJWT . verify ( jwsVerifier ) ; } catch ( ParseException | JOSEException ex ) { throw new HmacException ( "Cannot verify JWT" , ex ) ; } }
verify json web token
