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 6665855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:46:02+00:00 2026-05-26T02:46:02+00:00

I thought the solution to this would occur to me as I’ve sat on

  • 0

I thought the solution to this would occur to me as I’ve sat on this problem for many months – but my brain has not flags the obvious best approach.

I have two controller methods say “Edit” that are protected with an action filter that causes passive authentication to an STS.

[HttpGet]
public ActionResult Edit(Guid id) { [do stuff] }

[HttpPost]
public ActionResult Edit(Guid id, EditViewModel model) { [do stuff] }

The problem is, mvc receives the SignInResponseMessage and then fires the HttpPost which is not what I want… Anyone out there approached this issue and feel they’ve got a nice solution?

I guess I could uniquely name all my action methods if worst comes to worse i.e. the good old mvc1 Edit() vs Update() / New() vs Create() etc..

  • 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-26T02:46:03+00:00Added an answer on May 26, 2026 at 2:46 am

    I have a solution…

    Instead of allowing the STS to post to any url (and hit any action in the application), I use a setting in my STS to post to one url which has an action method that looks like this:

    public ActionResult Index() {
    
        if (MyIdentity.IsAuthenticated) {
            if (ControllerContext.HttpContext.Request["wreply"] != null)
            {
                var returnUrl = ControllerContext.HttpContext.Request["wreply"];
                if (returnUrl.StartsWith(Stgs.WebRt)) { return Redirect(returnUrl); } //make sure the wreply is actually for this application and not a random url
            }
    
            return Redirect("/"); 
        }
    
        return View(); 
    }
    

    Then in the STS when I’m building the SignOutResponseMessage I add the line:

    response.SetParameter("wreply", message.Reply);
    

    where “reponse” is a Microsoft.IdentityModel.Protocols.WSFederation.SignInReponseMessage and “message” is a is a Microsoft.IdentityModel.Protocols.WSFederation.SignInRequestMessage. This basically adds the wreply as a form input that is posted to the relying party. Hence making the controller action code above work as expected.

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

Sidebar

Related Questions

I thought that would have been simple but it is not working. I can,
I thought this would be simple enough but somethings wrong. The only Bootstrap gem
I know that snapshot isolation would fix this problem, but I'm wondering if NOLOCK
I thought I'd throw out this problem to see what elegant solutions folk could
I thought of solution below because the collection is very very small. But what
I have an interesting problem and would appreciate your thoughts for the best solution.
Thought my range of search options would easily find this. I wish to combine
I'm already tossing around a solution but as I haven't done something like this
How many times has this happened to you? You are typing a long block
Looking for a free spell checking solution, I thought I was so smart in

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.