mirror of
https://github.com/pierre42100/ComunicAndroid
synced 2024-11-23 13:59:29 +00:00
Integrated API tokens
This commit is contained in:
parent
9c06507d0c
commit
ee945f58e0
@ -16,8 +16,8 @@ android {
|
||||
debug {
|
||||
//Connexion to the internal API of Comunic
|
||||
buildConfigField "String", "api_url", "\"http://devweb.local/comunic/api/\""
|
||||
buildConfigField "String", "api_service_name", "\"testService\""
|
||||
buildConfigField "String", "api_service_token", "\"testPasswd\""
|
||||
buildConfigField "String", "api_service_name", "\"ComunicAndroid\""
|
||||
buildConfigField "String", "api_service_token", "\"5eQ8WGAeDTTyY\""
|
||||
}
|
||||
|
||||
release {
|
||||
|
@ -45,7 +45,8 @@ public class APIRequest {
|
||||
*/
|
||||
public APIResponse exec(APIRequestParameters parameters) throws Exception{
|
||||
|
||||
//Add login tokens
|
||||
//Add API and login tokens
|
||||
addAPItokens(parameters);
|
||||
addLoginTokens(parameters);
|
||||
|
||||
APIResponse result = new APIResponse();
|
||||
@ -113,6 +114,16 @@ public class APIRequest {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the API client tokens to API request object
|
||||
*
|
||||
* @param params The request parametres to update
|
||||
*/
|
||||
private void addAPItokens(APIRequestParameters params){
|
||||
params.addParameter("serviceName", BuildConfig.api_service_name);
|
||||
params.addParameter("serviceToken", BuildConfig.api_service_token);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the login tokens to an API request object
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user