@Test public void testAuthenticate() { doReturn(MOCK_APP_TOKEN).when(tokenUtils).generateToken(); doReturn(mockAppToken).when(appAuthenticationService).authenticate(MOCK_APP_ID, MOCK_APP_TOKEN); String result = jwtAuthentication.authenticate(MOCK_CONFIG_ID); assertEquals(MOCK_APP_TOKEN, result); }
public String authenticate(String configurationId) { Integration integration = getIntegrationAndCheckAvailability(configurationId); String appId = properties.getApplicationId(integration.getSettings().getType()); String appToken = tokenUtils.generateToken(); AppToken bothTokens = appAuthenticationService.authenticate(appId, appToken); String sessionToken = authenticationProxy.getSessionToken(integration.getSettings().getType()); apiClient.saveAppAuthenticationToken(sessionToken, configurationId, bothTokens); return appToken; }
JwtAuthenticationImpl implements JwtAuthentication { public String authenticate(String configurationId) { Integration integration = getIntegrationAndCheckAvailability(configurationId); String appId = properties.getApplicationId(integration.getSettings().getType()); String appToken = tokenUtils.generateToken(); AppToken bothTokens = appAuthenticationService.authenticate(appId, appToken); String sessionToken = authenticationProxy.getSessionToken(integration.getSettings().getType()); apiClient.saveAppAuthenticationToken(sessionToken, configurationId, bothTokens); return appToken; } }
JwtAuthenticationImpl implements JwtAuthentication { public String authenticate(String configurationId) { Integration integration = getIntegrationAndCheckAvailability(configurationId); String appId = properties.getApplicationId(integration.getSettings().getType()); String appToken = tokenUtils.generateToken(); AppToken bothTokens = appAuthenticationService.authenticate(appId, appToken); String sessionToken = authenticationProxy.getSessionToken(integration.getSettings().getType()); apiClient.saveAppAuthenticationToken(sessionToken, configurationId, bothTokens); return appToken; }  }
JwtAuthenticationImpl implements JwtAuthentication { public String authenticate(String configurationId) { Integration integration = getIntegrationAndCheckAvailability(configurationId); String appId = properties.getApplicationId(integration.getSettings().getType()); String appToken = tokenUtils.generateToken(); AppToken bothTokens = appAuthenticationService.authenticate(appId, appToken); String sessionToken = authenticationProxy.getSessionToken(integration.getSettings().getType()); apiClient.saveAppAuthenticationToken(sessionToken, configurationId, bothTokens); return appToken; }  @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 String authenticate(String configurationId) { Integration integration = getIntegrationAndCheckAvailability(configurationId); String appId = properties.getApplicationId(integration.getSettings().getType()); String appToken = tokenUtils.generateToken(); AppToken bothTokens = appAuthenticationService.authenticate(appId, appToken); String sessionToken = authenticationProxy.getSessionToken(integration.getSettings().getType()); apiClient.saveAppAuthenticationToken(sessionToken, configurationId, bothTokens); return appToken; }  @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);  }