Note that there are some explanatory texts on larger screens.

plurals
  1. POSend token with HTTP POST from android to cakephp
    primarykey
    data
    text
    <p>i am sending data from an android device to my cakephp website through HTTP Post in json object ..like this </p> <pre><code> HttpPost post = new HttpPost("https://www.mywebtest.com/test"); </code></pre> <p>and then i decode the json and extract the data like this </p> <pre><code> if ($this-&gt;request-&gt;isPost()){ $json = $this-&gt;request-&gt;data('json'); $data = json_decode($json, TRUE); </code></pre> <p>but at the moment i am not checking that whether the http post or data is coming from my android app or someone else .so if someone knows the url he can do something malicious ..because at times now the url which i have written in <strong>httpPost</strong> when i typed this url in my browser there is nothing is shown on the browser.. i want to display some kind of error or 404 page if some one typed the url in browser.. Essentially, you can say i am creating with CakePHP is an API, What i want to do is secure the API so only my app can execute requests.so i want to implement some type of authentication .. doing some research i come up to a solution that pass another parameter as a secret token from android app and then check token from my webapp and then extract data .. i dont know how can i pass another parameter in httppost and then check it on my webpage .. and also if that possible i want to randomly generate the token and encrypt it on every request and then decrypt it through key in webapp whenever the data is posting from android to webapp.. if someone has done before this or have an idea then please share code or any link.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload