@Test public void testIsValidTokenPair() { doReturn(MOCK_APP_TOKEN).when(tokenUtils).generateToken(); doReturn(mockAppToken).when(appAuthenticationService).authenticate(MOCK_APP_ID, MOCK_APP_TOKEN); doReturn(mockAppToken).when(apiClient).getAppAuthenticationToken( MOCK_SESSION_TOKEN, MOCK_CONFIG_ID, MOCK_APP_TOKEN); boolean result = jwtAuthentication.isValidTokenPair( MOCK_CONFIG_ID, MOCK_APP_TOKEN, MOCK_SYMPHONY_TOKEN); assertTrue(result); }
public boolean isValidTokenPair(String configurationId, String applicationToken, String symphonyToken) { Integration integration = getIntegrationAndCheckAvailability(configurationId); String sessionToken = authenticationProxy.getSessionToken(integration.getSettings().getType()); AppToken bothTokens = apiClient.getAppAuthenticationToken(sessionToken, configurationId, applicationToken); if (bothTokens == null) { return false; } return symphonyToken.equals(bothTokens.getSymphonyToken()); }
JwtAuthenticationImpl implements JwtAuthentication { public boolean isValidTokenPair(String configurationId, String applicationToken, String symphonyToken) { Integration integration = getIntegrationAndCheckAvailability(configurationId); String sessionToken = authenticationProxy.getSessionToken(integration.getSettings().getType()); AppToken bothTokens = apiClient.getAppAuthenticationToken(sessionToken, configurationId, applicationToken); if (bothTokens == null) { return false; } return symphonyToken.equals(bothTokens.getSymphonyToken()); } }
JwtAuthenticationImpl implements JwtAuthentication { public boolean isValidTokenPair(String configurationId, String applicationToken, String symphonyToken) { Integration integration = getIntegrationAndCheckAvailability(configurationId); String sessionToken = authenticationProxy.getSessionToken(integration.getSettings().getType()); AppToken bothTokens = apiClient.getAppAuthenticationToken(sessionToken, configurationId, applicationToken); if (bothTokens == null) { return false; } return symphonyToken.equals(bothTokens.getSymphonyToken()); }  }
JwtAuthenticationImpl implements JwtAuthentication { public boolean isValidTokenPair(String configurationId, String applicationToken, String symphonyToken) { Integration integration = getIntegrationAndCheckAvailability(configurationId); String sessionToken = authenticationProxy.getSessionToken(integration.getSettings().getType()); AppToken bothTokens = apiClient.getAppAuthenticationToken(sessionToken, configurationId, applicationToken); if (bothTokens == null) { return false; } return symphonyToken.equals(bothTokens.getSymphonyToken()); }  @PostConstruct void init(); Long getUserIdFromAuthorizationHeader(String configurationId, String authorizationHeader); JwtPayload getJwtToken(String configurationId, String authorizationHeader); Long getUserId(JwtPayload token); String authenticate(String configurationId); boolean isValidTokenPair(String configurationId, String applicationToken,
      String symphonyToken); JwtPayload parseJwtPayload(String configurationId, String jwt); @Override boolean checkPodInfo(String configurationId, String podId); }
JwtAuthenticationImpl implements JwtAuthentication { public boolean isValidTokenPair(String configurationId, String applicationToken, String symphonyToken) { Integration integration = getIntegrationAndCheckAvailability(configurationId); String sessionToken = authenticationProxy.getSessionToken(integration.getSettings().getType()); AppToken bothTokens = apiClient.getAppAuthenticationToken(sessionToken, configurationId, applicationToken); if (bothTokens == null) { return false; } return symphonyToken.equals(bothTokens.getSymphonyToken()); }  @PostConstruct void init(); Long getUserIdFromAuthorizationHeader(String configurationId, String authorizationHeader); JwtPayload getJwtToken(String configurationId, String authorizationHeader); Long getUserId(JwtPayload token); String authenticate(String configurationId); boolean isValidTokenPair(String configurationId, String applicationToken,
      String symphonyToken); JwtPayload parseJwtPayload(String configurationId, String jwt); @Override boolean checkPodInfo(String configurationId, String podId);  }