@Test public void test_validateToken_valid() throws GeneralSecurityException, IOException, ServerMisconfigurationException { CheckerResult result = checkerToTest.validateToken(VALID_ACCESS_TOKEN, APP_ID); Assert.assertNotNull(result.getPayload()); Assert.assertEquals(ValidationResult.VALID, result.getResult()); }
@Override public CheckerResult validateToken(String token, String appId) throws GeneralSecurityException, IOException, ServerMisconfigurationException { CheckerResult result = new CheckerResult(); result.setResult(ValidationResult.INVALID); IApiTokenContents accessToken = tokenService.introspectAccessToken(token); result.setPayload(accessToken); if (accessToken == null) { result.setResult(ValidationResult.INVALID); } else { result.setResult(ValidationResult.VALID); } return result; }
MitreidAccessTokenChecker implements IChecker { @Override public CheckerResult validateToken(String token, String appId) throws GeneralSecurityException, IOException, ServerMisconfigurationException { CheckerResult result = new CheckerResult(); result.setResult(ValidationResult.INVALID); IApiTokenContents accessToken = tokenService.introspectAccessToken(token); result.setPayload(accessToken); if (accessToken == null) { result.setResult(ValidationResult.INVALID); } else { result.setResult(ValidationResult.VALID); } return result; } }
MitreidAccessTokenChecker implements IChecker { @Override public CheckerResult validateToken(String token, String appId) throws GeneralSecurityException, IOException, ServerMisconfigurationException { CheckerResult result = new CheckerResult(); result.setResult(ValidationResult.INVALID); IApiTokenContents accessToken = tokenService.introspectAccessToken(token); result.setPayload(accessToken); if (accessToken == null) { result.setResult(ValidationResult.INVALID); } else { result.setResult(ValidationResult.VALID); } return result; }  }
MitreidAccessTokenChecker implements IChecker { @Override public CheckerResult validateToken(String token, String appId) throws GeneralSecurityException, IOException, ServerMisconfigurationException { CheckerResult result = new CheckerResult(); result.setResult(ValidationResult.INVALID); IApiTokenContents accessToken = tokenService.introspectAccessToken(token); result.setPayload(accessToken); if (accessToken == null) { result.setResult(ValidationResult.INVALID); } else { result.setResult(ValidationResult.VALID); } return result; }  @Override String getId(); @Override CheckerResult validateToken(String token, String appId); }
MitreidAccessTokenChecker implements IChecker { @Override public CheckerResult validateToken(String token, String appId) throws GeneralSecurityException, IOException, ServerMisconfigurationException { CheckerResult result = new CheckerResult(); result.setResult(ValidationResult.INVALID); IApiTokenContents accessToken = tokenService.introspectAccessToken(token); result.setPayload(accessToken); if (accessToken == null) { result.setResult(ValidationResult.INVALID); } else { result.setResult(ValidationResult.VALID); } return result; }  @Override String getId(); @Override CheckerResult validateToken(String token, String appId); final static String ID; }