security - How to secure calling webservice in Android -



security - How to secure calling webservice in Android -

hello working on android application in required execute few https web services webservice url , web api key in code plus ip address of server. when reverse engineering science of app guy can web service url api key can nail using rest client.

how secure such attacker can't anyhow web api key defined in strings.xml

<string name="web_api_key">xxxxxxxxxxxxxxxxxxxxxxxxxxx</string>

thanks in advance.

i have faced same issue. first ensure app have created calling webservice only. if key reveres engineering. secondly valid user calling application. next checks done in server.

1)verify it’s signed google.

2)verify it’s meant you.

you need utilize google developer console https://console.developers.google.com/project?authuser=0 create 2 client ids (one server , other android application.) under menu api & auth. create client id android application can utilize keytool keytool -exportcert -alias <your-key-name> -keystore <your-key-store-file> -v -list

i have followed steps here

serverside php sample given below

function checksession($token){ $result = array(); if(isset($_server['https'])) { if ($_server["https"] == "on") { $secure_connection = true; } } if($secure_connection){ seek { $client = new google_client(); $client->setclientid(client_id); $client->setclientsecret(client_secret); $ticket = $client->verifyidtoken($token); $validtocken = false; if($ticket){ $token_data = $ticket->getattributes(); if($token_data ["payload"]["aud"]==client_id && $token_data ["payload"]["azp"]==android_id){ $validtocken = true; $result["email"]=$token_data ["payload"]["email"]; } else { log_message(serialize($token_data)); } } } grab (exception $e) { $result["details"]=$e->getmessage(); } }

android security ssl proguard dexguard

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -