Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6620533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:06:47+00:00 2026-05-25T21:06:47+00:00

Our system is MVC2 authenticated by ADFS 2. So when a user clicks on

  • 0

Our system is MVC2 authenticated by ADFS 2. So when a user clicks on a bookmark for http://www.foo.com/Car/Details/3, this hits our Car controller and calls our Details GET action handler and passes 3 in as the ID (all basic MVC stuff). So we have this ActionHandler decorated with a [Authorize] attribute and have ADFS2 hooked up, so the page then redirects to our auth server which then redirects back to our app, but with a POST (all basic ADFS stuff). The problem is that this redirect is a POST and therefore our Details POST handler is called, but clearly it doesn’t have the data I need.

Now I have identified some code that detects this scenario and this code looks something like this:

[Authorize]
[MySpecialHttpGet]
public ActionResult Details(long id)
{
    var model = GetModel(id);
    return View(model);
}

[Authorize]
[MySpecialHttpPost]
public ActionResult Details(long id, ViewModel model)
{
    /***START OF SPECIAL CODE***/
    // If we were posted to by ADFS, redirect to the GET handler.
    if (Request.Form["wa"] != null && Request.Form["wa"].ToLower().Contains("signin"))
    {
        // We were posted to here but need to respond with the GET view.
        return Redirect(Request.Url.AbsoluteUri);
    }
    /***END OF SPECIAL CODE***/

    var result = Something.SaveData(model);
    return result.ActionResultToReturnWith;
}

The problem with this is that I need to do this on every single POST ActionHandler in the app and I really don’t want to do that. Given that I already have custom attributes on all of these ActionHandlers, I would like to use those attributes to inject this functionality for me.

Now the MySpecialHttpGet and MySpecialHttpPost are nothing incredibly special that you really need to know about other than they extend ActionMethodSelectorAttribute. I would LIKE to add code in the MySpecialPost attribute to inject that functionality.

So my question:

How would I add code to perform this kind of check in this Attribute?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:06:47+00:00Added an answer on May 25, 2026 at 9:06 pm

    For now, we have not found the solution we wanted and are simply pasting that code (well, a function call with that code in it) at the beginning of EVERY controller.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As part of one our system's we enable a user in the backoffice to
Our (asp.net) system is part of a larger system. It is launched via this
In our system we are reading user security groups from an Active Directory in
In our system our database looks like this One agency has many brokerages, one
A user of our system (Silverlight 4/WCF Ria Services) has a problem using Internet
My requirement is Our users are Authenticated by External System using SSO. On successful
Currently on our system, when a user contacts us, we reply via our admin
Our system dynamically generates a large report by converting many HTML pages into a
Our system will run on a local network with no more than 50 clients
Our system (exotic commodity derivative trade capture and risk management) is being redeveloped shortly.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.