added expiration time of application access token

merge-requests/1/head
GPrathap 8 years ago
parent 9bcaea05fd
commit 752b2e8dbf

@ -226,7 +226,8 @@ public class ArduinoServiceImpl implements ArduinoService {
APIManagementProviderService apiManagementProviderService = APIUtil.getAPIManagementProviderService();
String[] tags = {ArduinoConstants.DEVICE_TYPE};
apiApplicationKey = apiManagementProviderService.generateAndRetrieveApplicationKeys(
ArduinoConstants.DEVICE_TYPE, tags, KEY_TYPE, applicationUsername, true);
ArduinoConstants.DEVICE_TYPE, tags, KEY_TYPE, applicationUsername, true,
ArduinoConstants.APIM_APPLICATION_TOKEN_VALIDITY_PERIOD);
}
JWTClient jwtClient = APIUtil.getJWTClientManagerService().getJWTClient();
String scopes = " device_" + deviceId;

@ -25,4 +25,6 @@ public class ArduinoConstants {
//sensor events summerized table name
public static final String TEMPERATURE_EVENT_TABLE = "DEVICE_TEMPERATURE_SUMMARY";
public static final String APIM_APPLICATION_TOKEN_VALIDITY_PERIOD = "3600";
}

@ -210,7 +210,8 @@ public class RaspberryPiServiceImpl implements RaspberryPiService {
APIManagementProviderService apiManagementProviderService = APIUtil.getAPIManagementProviderService();
String[] tags = {RaspberrypiConstants.DEVICE_TYPE};
apiApplicationKey = apiManagementProviderService.generateAndRetrieveApplicationKeys(
RaspberrypiConstants.DEVICE_TYPE, tags, KEY_TYPE, applicationUsername, true);
RaspberrypiConstants.DEVICE_TYPE, tags, KEY_TYPE, applicationUsername, true,
RaspberrypiConstants.APIM_APPLICATION_TOKEN_VALIDITY_PERIOD);
}
JWTClient jwtClient = APIUtil.getJWTClientManagerService().getJWTClient();
String scopes = " device_" + deviceId;

@ -31,4 +31,6 @@ public class RaspberrypiConstants {
//mqtt tranport related constants
public static final String MQTT_ADAPTER_TOPIC_PROPERTY_NAME = "mqtt.adapter.topic";
public static final String APIM_APPLICATION_TOKEN_VALIDITY_PERIOD = "3600";
}

@ -309,7 +309,8 @@ public class VirtualFireAlarmServiceImpl implements VirtualFireAlarmService {
APIManagementProviderService apiManagementProviderService = APIUtil.getAPIManagementProviderService();
String[] tags = {VirtualFireAlarmConstants.DEVICE_TYPE};
apiApplicationKey = apiManagementProviderService.generateAndRetrieveApplicationKeys(
VirtualFireAlarmConstants.DEVICE_TYPE, tags, KEY_TYPE, applicationUsername, true);
VirtualFireAlarmConstants.DEVICE_TYPE, tags, KEY_TYPE, applicationUsername, true,
VirtualFireAlarmConstants.APIM_APPLICATION_TOKEN_VALIDITY_PERIOD);
}
JWTClient jwtClient = APIUtil.getJWTClientManagerService().getJWTClient();
String scopes = " device_" + deviceId;

@ -83,4 +83,6 @@ public class VirtualFireAlarmConstants {
public static final String SERVER_NAME = "serverName";
public static final String MQTT_ADAPTER_TOPIC_PROPERTY_NAME = "mqtt.adapter.topic";
public static final String APIM_APPLICATION_TOKEN_VALIDITY_PERIOD = "3600";
}

Loading…
Cancel
Save