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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:04:23+00:00 2026-05-23T09:04:23+00:00

I am setting up an end-point using ASP.NET MVC to which requests can be

  • 0

I am setting up an end-point using ASP.NET MVC to which requests can be made to manipulate and retrieve data (basically, an API). I am using a 2-legged OAuth model to validate that requests be signed using a secret key and signing method as well as a nonce table to prevent hi-jacking.

Since Model Binding is so handy in ASP.NET MVC I am going to take advantage of it to consume requests, but I wonder if I can bake the signature verification and nonce/timestamp handling right into the model binder. Is this possible? That way I can just re-use the implementation on the various Actions that I create.

  • 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-23T09:04:24+00:00Added an answer on May 23, 2026 at 9:04 am

    I reckon you should be able to. Try this:

    public class FooModelBinder : IModelBinder
        {
            public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
            {
                FooModel fooModel = bindingContext.Model as fooModel;
                if (fooModel != null)
                {
                   // Do your verification stuff in here
                   // Updating any properties of your Model.
                   // Or you could retrieve something else entirely and return it if you like
                   // Let's pretend we just want to verify the model and set some property or other.
                   fooModel.NonceOkay = DoVerification(fooModel);
                   fooModel.NextAction = WorkOutWhereToGoNext(fooModel);
                   // or whatever
                }
                return fooModel;
            }
        }
    

    DoVerification could live in your ModelBinder, but it might be better for it to live somewhere else.

    Then stick this in Application_Start in your Global.asax:

    ModelBinders.Binders.Add(typeof(Foo), new FooModelBinder());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using ASP.NET MVC to develop an application framework. Essentially, the end goal
Setting up ASP.net MVC with Linq2SQL or Entity Framework's context to have scaffolding work
Setting the scene: My asp.net web application carries a version number which is incremented
Still learning asp.net and mvc, please be gentle :) Currently setting up an MVC
We are using MS Access as a reporting front-end for Oracle. The data is
I would like to know if it is possible using IIS and ASP.NET (and
I have an asp.net mvc app running on a local iis website that is
What are the best practices for setting up projects with multiple interfaces in asp.net
Can anyone point me towards documentation on this? I'm using Devise + CanCan in
I have an ASP.NET MVC 3 application that uses a WCF service within the

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.