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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:11:29+00:00 2026-06-08T04:11:29+00:00

Here’s our scenario: We have an MVC3 Application ‘MVC3ABC’ in solution S1 that is

  • 0

Here’s our scenario:

  • We have an MVC3 Application ‘MVC3ABC’ in solution S1 that is secured using Forms Authentication (currently the user details are just in the web.config for early dev but they will be in an SQL Server database soon).

  • MVC Controller C1 calls through to a WCF service W1 which has the .svc file under a separate ASP.NET web project in solution S1. In this case, the WCF service does not need to know which particular user is logged in, just that it is an authenticated user accessing.

  • MVC View V1 is hosting a Silverlight4 App SLV1 which calls through to a WCF service W2 which has the .svc file under a separate AST.NET web project in a different solution S2. In this case, the WCF service does need to know which particular user is logged in as it will get data from different databases depending on which user is logged into the MVC site.

So essentially, what we require is that access to the two WCF services can be done from the MVC site by users already authenticated through the MVC application and in the case of the W2 service, we need to know which user it is. Any access to the WCF services outside the MVC site needs to also be authenticated or shouldn’t work (no anonymous access to the WCF services is permitted).

Is there a standard approach to solving this problem? Does anyone know of any sample projects where I can see this kind of thing in action?

A few extra details – we are using Visual Studio 2012 RC, .NET 4.5 and IIS7.

Thanks

  • 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-08T04:11:32+00:00Added an answer on June 8, 2026 at 4:11 am

    I guess what you are trying to achieve is sharing the Forms Authentication across MVC application and the WCF services. You could do that 🙂

    The idea is you have to share the cookie from the MVC application to the WCF services.

    Following are the things you have to take care on doing this.

    1. The MVC and WCF services should use the same forms and machineKey sections in the web.config. See here. Means WCF services should also use forms authentication and all the three of them should share the same machine key to have the cookie being shared.

    2. Of course the WCF services should run in asp.net compatibility mode.

    3. When making calls to WCF services you should manually add the forms authentication cookie to the outgoing message header. See here.

    EDIT:

    Based upon the OP’s comment I’m updating my answer.

    The above solution seems to be good when the WCF service has to be used only by the MVC and not by other clients. But if the WCF service also want to be consumed by different clients other than the MVC project then the client will face tough time because they have to construct the cookie and append to the request (i’m not sure whether this is possible!).

    So little more elegant solution would be make the WCF services self-contained, means, integrate the authentication/authorization mechanism separately to it. One way is you can easily integrate the ASP.NET membership provider to the WCF services. By this way the authentication will happen separately at the WCF service side. The other advantages are third-party clients or other applications can easily consume the WCF service passing the credentials through the proxy.

    So here is a link that says how to configure asp.net membership provider in WCF service,

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

Sidebar

Related Questions

Here's my scenario - I have an SSIS job that depends on another prior
Here is the problem that I am trying to solve. I have two folders
Here is my code (Say we have a single button on the page that
Here is the issue I am having: I have a large query that needs
Here is the scenario: I'm writing an app that will watch for any changes
Here is the Javascript I currently have <script type=text/javascript> $(function() { $('.slideshow').hover( function() {
Here is the script I'm using, copied directly from Google: <script type=text/javascript> var _gaq
Here is the scenario. I'm writing my geo-ruby oracle adapter for Ruby On Rails
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Here's the basic setup: I have a thin bar at the top of a

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.