Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
SQL
I'm working on a RESTful mobile application using ASP.Net Web APIs. I am inclined to use Basic authentication. I have followed some articles which gave me good start. I understood that "username:password" will be encoded and added to "Authorization: Basic " and sent it as header on subsequent http requests after authentication. But I have only one thing missing here is,
1.How do I send this "username:password" encoded string on every http request without using session or cookies
In Forms Authentication a cookie will be set. In membership User Principal will be set.
All http requests to web api comes from ajax and I need to set authorization header in beforeSend. But where do I get "username:password" encoded string from, on every page ajax request
Posted

1 solution

Follow both of article which will help you to make your requirement fullfil
Send Parameter using HTTP request
security/basic-authentication[^]
Encode your password
how-to-encrypt-and-decrypt[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900