ASP.NET MVC - HTTP Authentication Prompt

后端 未结 4 2097
轮回少年
轮回少年 2020-11-28 04:44

Is it possible to make my application ask for username and password prompting for it before render a view? Just like on twitter API to get information about your account:

4条回答
  •  感情败类
    2020-11-28 05:32

    You really want to create a service and not a web application, based on what I have read. I am guessing here, but I think you picked ASP.NET MVC to take advantage of the routing and building the URL's the way you want? Correct me if I am wrong.

    In my opinion the best way to solve the problem you are having is to build RESTful web services with WCF if you are returning data. This article should help you get started if you want to go this route.

    Otherwise, you will need to go further up the stack for handling the request and authenticating it. If this is the case, I can help with providing more info and code.

提交回复
热议问题