How store token from POST sent from external application

J Fisher 0 Reputation points
2024-10-11T14:39:27.7633333+00:00

We have a .NET WebForms application ("NetApp") that is launched from a WebFOCUS application ("WF") via a POST request, passing a token. NetApp cannot grab this token when a POST is used by WF, but when GET is used by WF, no problem. Fiddler indicates the data is being sent, and there is no certificate issue, but in NetApp Request.Form["id"] is empty, as is StreamReader(Request.InputStream). If this is a security feature of Microsoft, is there a way around this so that I can store in NetApp the token passed in the POST from WF?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,911 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 54,806 Reputation points
    2024-10-11T14:45:27.7566667+00:00

    That completely depends on how the token is being passed. Can you provide sample request/response data, including headers, for the POST and GET requests? In general a token (such as a security token) is passed as part of the headers. Therefore you'd need to access the request's headers if you are being called by the WF app. If you are calling the WF app and it is returning a response then you'd need to go to the response headers instead.

    The Form fields are only available if the data is being passed as part of the body. For a POST this is possible but GET requests won't have a body.

    0 comments No comments

  2. Bruce (SqlWork.com) 66,456 Reputation points
    2024-10-11T16:08:53.77+00:00

    check that the content type header is correct and body looks like

    id=value

    If your posting to a webform, instead of a webapi, you may need to do a get first of the page to get a valid viewstate value to include in the post.

    id=value&_VIEWSTATE=value

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.