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

The Archive Base Latest Questions

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

I am using Windows Identity Foundation with Azure’s AppFabric Access Control Service in a

  • 0

I am using Windows Identity Foundation with Azure’s AppFabric Access Control Service in a MVC3 site. What I am trying to figure out is how to control where WIF redirects the user if I have an AuthorizeAttribute on a controller or action. (This is my first time working with WIF and there doesn’t seem to be a lot of good information available.)

I have disabled auto-forwarding because it kept sending me to the default ACS authentication page. I want to keep users on my site using my custom login page, but I cannot seem to figure out what settings need to be tickled to do this.

Is there a way, natively with WIF, to tell it to redirect to my login page or am I going to have to write my own AuthorizeAttribute to do this for me?

Thanks!

Edit:

Since there has been some activity on this lately, I figured I would write out some of my findings. Unfortunately, I am not 100% what caused everything to work properly (so many moving parts) but I did finally get WIF to redirect to my login page.

I did this without adding any code to the program and, instead, deviated a little from the examples I found. I found that keeping the forms authentication portion of web.config allowed everything to work. In my web.config I have the normal forms auth entry:

<system.web>
    <httpRuntime requestValidationMode="2.0" />
    <authentication mode="Forms" >
        <forms loginUrl="~/Account/Login" timeout="2880" />
    </authentication>
    ...
</system.web>

Disclaimer: I do not know if this is the right way to do things with WIF–it just happens to solve my problem. I can use the regular [Authorize] attribute on controllers or actions and I get proper redirects to the login page as if I was using forms authentication.

  • 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-23T05:10:04+00:00Added an answer on May 23, 2026 at 5:10 am

    I’ve played a little bit more with a sample and depending on what you need to do before redirecting, it might or ight not help.

    In the global.asax, I’ve added a handler to the “RedirectingToIdentityProvider” event and I customized it to add say, the whr parameter. To do this, you need to first add a handler to the ConfigurationCreated event:

    protected void Application_Start()
    {
        AreaRegistration.RegisterAllAreas();
    
        RegisterRoutes(RouteTable.Routes);
    
        FederatedAuthentication.ServiceConfigurationCreated += new EventHandler<Microsoft.IdentityModel.Web.Configuration.ServiceConfigurationCreatedEventArgs>(FederatedAuthentication_ServiceConfigurationCreated);   
    }
    
        void FederatedAuthentication_ServiceConfigurationCreated(object sender, Microsoft.IdentityModel.Web.Configuration.ServiceConfigurationCreatedEventArgs e)
        {
            var m = FederatedAuthentication.WSFederationAuthenticationModule;
            m.RedirectingToIdentityProvider += new EventHandler<RedirectingToIdentityProviderEventArgs>(m_RedirectingToIdentityProvider);
        }
    
        void m_RedirectingToIdentityProvider(object sender, RedirectingToIdentityProviderEventArgs e)
        {
            var sim = e.SignInRequestMessage;
            sim.HomeRealm = "Google";
        }
    

    This works with the standard Authorize attribute.

    If this extensibility point is not enough, then you can write our own attribute to have full control of the process.

    Look at sample #3 or #7. Not MVC3, but on MVC2 and very close to what you are doing. http://claimsid.codeplex.com

    The process is described here:

    http://msdn.microsoft.com/en-us/library/ff966481.aspx#sec14

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

Sidebar

Related Questions

We are calling a third-party service using Windows Identity Foundation. The service is called
I'm using the Windows Identity Foundation (WIF) Security Token Service (STS) to handle authentication
We have implemented SSO in a .NET web application using Windows Identity Foundation (WIF).
I'm trying to get a WCF service set up on our server using windows
I'm trying to get my head around all the claims based windows identity foundation
We have a WCF (Windows Communication Foundation) client and service application. We're using Windows
I am trying to host a WCF web service in IIS using Windows Authentication.
I am using Windows Identity foundation. In one of the sites protected by W.I.F,
I'm in a ASP.NET application using Windows Authentication. I'm using HttpContext.Current.User.Identity.Name to get the
I am trying to implement claims based security using System.IdentityModel. We are using Windows

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.