C # Forms Authentication with Form Data

I have two applications, for example an application. A and Appendix. B. Application A. submits form data (using the post method) to application B. B, however, is a web application and uses forms authentication. The post data is sent to the web page (viewdocument.aspx), which is secured with forms authentication. But when the data is sent to the viewdocument, the login page is displayed as the user is not authenticated.

The bottom line is that I want the post data to be read by the viewdocument. How can i do this?

+2


source to share


3 answers


You can allow all users to access your viewdocument page (by setting authorization in your web.config), get the message values ​​in your page load, and then manually:

if (!User.Identity.IsAuthenticated)
  FormsAuthentication.RedirectToLoginPage();

//Else continue with page display

      



This way you will protect the display of your page, but you can send data to the page with any user.

I hope this helps

0


source


If your web application is only to use web services to consume data.



0


source


I think you want to consider separating the two processes - receiving data from another website and displaying the data to the user. This way you get great separation of logic that can improve maintainability. And I'm not sure how you are going to POST data from one site to another, since the POST should go back to the original web page. I would do as @Kane suggested in his comment and use a service to accept incoming data. This could be built to accept current data, but it would also be easily extensible if you ever needed to fetch data from other sites. Your page for displaying data will be much easier and more understandable for developers.

0


source







All Articles