3
Hello, I have a link where it opens a modal window (as if it were an "Alert") to enter the login and password. I am using jQuery, the $.ajax{} function to be more specific. I would like to know how to send my login and password in its header. What type of command should I use? Authentication? How?
How can I make him identify the login and password? Because it asks 2 (user and password) and with these codes it seems to me that only for me to put, for example "user"
– Alisson Acioli
I didn’t get it right, but I edited the answer and put 2 values in the header, that’s it ?
– Alan PS
Yes, more or less so. I would just like to know how to do it entered the login in the "login" and password field in the "password". Because he has to have the authorization to enter the admin panel and to have authorization he needs to inform this login and password
– Alisson Acioli
take a look here: http://stackoverflow.com/questions/5507234/how-to-use-basic-auth-and-jquery-and-ajax
– Alan PS
added to Cód. 2 variables with the value of the fields...
– Alan PS
With this I can be logging into an external system that asks for login and password? I have meusite.com and wanted to log in to your site.com would work? authenticates?
– Alisson Acioli
take a look here: http://www.html5rocks.com/en/tutorials/cors/
– Alan PS
I read it, I just don’t understand how it does authentication
– Alisson Acioli
Hello, if it’s HTTP set in ajax the
username
: andpassword:
which are fields for HTTP authentication.– Edilson
They ask for my token, I inform them to authenticate only that returns me in Chrome error 401 Unauthorized
– Alisson Acioli