cómo obtener respuesta solo solicitud de javascript procesada
Frecuentes
Visto 52 veces
0
I have a service url that includes username password like this: http://service.com/token?username=asd&password=123 But I can not send a request from javascript, because username and password is appearing from browser source code. So I created a Proxy page on server that sends request to service and gets token like this: http://mydomain.com/Token/GetToken I created an index page http://mydomain.com/index.html and javascript code sends request to Proxy page and gets token.
But somebody write a server page that sended request to my Proxy page (http://mydomain.com/Token/GetToken). And can get token.
I want to that only my rendered pages should send request to my Proxy page. Is this possible?
I am using .net mvc Project.
1 Respuestas
0
The general approach is to use an existing authentication framework to protect http://mydomain.com/Token/GetToken.
If you're using a PHP backend I suggest uIniciar sesión
Respondido el 02 de diciembre de 13 a las 08:12
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas javascript proxy cross-domain or haz tu propia pregunta.
You can check from which host the request is coming. In http request host name will be specified. If it is not from your server simply return some 401. - Triode