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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:45:54+00:00 2026-06-14T14:45:54+00:00

I am running Win 7, IIS 7.0, VS2012 I have created asp.mvc4 web app

  • 0

I am running Win 7, IIS 7.0, VS2012
I have created asp.mvc4 web app
I have ADFS2.0 on a separate VM

Using the Identity and Access tools in VS 2012

I select use a business identity provider (e.g.ADFS2) and type the url to the STS metadata document.

https://server.local/federationmetadata/2007-06/federationmetadata.xml

edited the web config

<system.web>
...
<httpModules>
...
    <remove name="FormsAuthentication" />
</httpModules>
</system.web>

and this

<system.webServer>
...
   <modules>
   ...
      <remove name="FormsAuthentication" />
   </modules>
</system.webServer>

Also have checked that Windows Authentication was disabled for the project

The website redirects to a url like this http:// localhost /WebSite/login.aspx?ReturnUrl=%2fWebSite%2f which has a ‘The resource cannot be found’ error.

What else do I have to fiddle with to make this work?

The Microsoft doco is lightweight http://blogs.msdn.com/b/vbertocci/archive/2012/03/15/windows-identity-foundation-tools-for-visual-studio-11-part-iii-connecting-with-a-business-sts-e-g-adfs2.aspx

I already have had similar problems with the local development STS MS Identity and Access Tool MVC 4

  • 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-06-14T14:45:55+00:00Added an answer on June 14, 2026 at 2:45 pm

    Ok this has taken me days to work out but these were the things I did to get it running. There is much more to do.

    Prerequisites:

    • An ADFS 2.0 service running somewhere on your domain.
    • IIS 7 with a self signed certificate or a certificate that you can use across your domain.
    • Visual Studio 2012 with the Identity and Access (version 1.0.2) Extension installed.
    • A MVC4 web application set to run on IIS.
    • Ensure that Self Signed Certificate is added to the site so you can access it via https.
    • You may have to tweak the firewall settings of you machines to allow access to your ADFS 2.0 service.

    On the Development Workstation

    In your MVC4 Project

    • Open up the Identity and Access Dialog by right-clicking your web project.
    • Choose Use a business identity provider (e.g. ADFS2)
    • Enter the path to the STS metadata document e.g. https://{PATH TO ADFS SERVER}/FederationMetadata/2007-06/FederationMetadata.xml
    • Enter the realm for your application e.g. https://{WEB APPLICATION URL}/
    • The trailing slash makes a difference.
    • Exit the dialog by accepting these changes.

    Add the following code to your project

    using System;
    using System.IdentityModel.Services;
    
    namespace NAMESPACE
    {
        public class FixedWsFederationAuthenticationModule : WSFederationAuthenticationModule
        {
            public override void RedirectToIdentityProvider(string uniqueId, string returnUrl, bool persist)
        {
            //This corrects WIF error ID3206 "A SignInResponse message may only redirect within the current web application:"
            //First Check if the request url doesn't end with a "/"
            if (!returnUrl.EndsWith("/"))
            {
                //Compare if Request Url +"/" is equal to the Realm, so only root access is corrected
                //https://localhost/AppName plus "/" is equal to https://localhost/AppName/
                //This is to avoid MVC urls
                if (String.Compare(System.Web.HttpContext.Current.Request.Url.AbsoluteUri + "/", base.Realm, StringComparison.InvariantCultureIgnoreCase) == 0)
                {
                    //Add the trailing slash
                    returnUrl += "/";
                }
            }
            base.RedirectToIdentityProvider(uniqueId, returnUrl, persist);
        }
    }
    }
    

    On the ADFS 2.0 Server

    • If you used a self signed certificate navigate to your web application https://{WEB APPLICATION URL}/ and change the zone to trusted site.
    • In the address bar of the browser you should be able to right click on the certificate and install (you can only install Certificates from trusted sites) The certificate needs to be installed under Trusted Root Authorities -> Registry,
    • Open the ADFS Console, add Relying Party Trusts, with Federated Metadata address https://{WEB APPLICATION URL}/FederationMetadata/2007-06/FederationMetadata.xml

    Add some custom rules

    MVC4 needs these rules in order to make a usable ClaimsPrincipal

    Add a pass-through rule on the Name property.

    And these 2 custom rules

    => issue(Type = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", Value = "true");
    
    => issue(Type = "http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider", Value = "true");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running a very simple Web application (Asp.Net MVC3) on Win 7 IIS.
I have coded up an ASP.NET website and running on win'08 (remotely hosted). The
ASP.NET newbie here I have coded up an ASP.NET website and running on win'08
I have an Asp.Net MVC 2 web application deployed on IIS 7.5 on .Net
I'm running my MVC 3 app (recently updated from 2) on IIS 7.5 (Win
I'm running win server 2008 R2 with IIS 7.5 I have an application under
I am running an ASP.NET 3.5 web application on IIS 7 on Windows Server
I have a wcf self-hosted service running as windows service, serving multiple win/web clients
Running PHP under IIS on my Win XP Pro system. I cannot debug my
I just installed .NET 4.0 on my Win 2003 Server running IIS. I didn't

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.