asp.net mvc - RESTful WCF Data Service Authentication -


I want to apply a RET API to an existing ASP.NET MVC website. I have managed to install WCF data services so that I can see my data, but now the question is how to handle authentication.

The data service is now certified through the creation of the site, and it is okay when access to the service from AJAX forms. However, this is not ideal for a cool API.

What would I like as an alternative to form authentication that the username and password in the user's URL is embedded in the web service or simply as the request parameters for.

For example, if my web service is usually

  http: // localhost: 1234 / api.svc  

I would like to be able to access this URL using

  http: // localhost: 1234 / api.svc / {login} / {password} < / Code> 

So, my questions are as follows:

  • Is this a sensible approach?

  • If so, how can I apply it?

It seems that there is a slight redirection request so that the login and password are attached as GET parameters. I also know how to inspect the HTTP reference and the results Use those parameters to filter. But I'm not sure if the same approach can be applied to what / how to post, PUT and DELETE requests can I use GET parameters in POST, can I request PUT and DELETE?

Edit: How to embed the URL and enter the password of the web service, the questions for me so that I can post, put it against the web service and delete the request I know How can the authentication be implemented after the web service is running and the login / password is included in the HTTPContext anywhere. Apart from this, I am not looking for ways to implement forms or basic authentication. I know how to do it, but it is not what I see.

   & Lt; / Webservices & gt; & Lt; / Script & gt; & Lt; /system.web.extensions>  

How about it?


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -