0
Hello,
I developed a Restful Web-Service in PHP using the SLIM framework and an android app to consume its services. It’s working fine, however, the GET request replies, which are returned in JSON format, are fully exposed when I access the service URL directly.
I would like to know how to encapsulate these answers on the server side so that they are recovered only by the client when it is consuming the service.
You can create an automatic token to be generated in the application and be validated in the Webservice. Hence the result will only be shown if the token has been validated. A basic example would be to create a token with the date and time of the query and then Webservice will approve this token until as many seconds after.
– Carlos Andrade
Or, if the sending of the information is passed via GET in a Url, you could create an additional variable, e.g.:
&target=app_android
and in Webservice check if this variable exists in the Url.– Carlos Andrade