@Test(expected = ServerMisconfigurationException.class) public void test_validateToken_misconfigured_server() throws GeneralSecurityException, IOException, ServerMisconfigurationException { checkerToTest.validateToken(MISCONFIGURED_SERVER_ACCESS_TOKEN, APP_ID); }
@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; }