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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:29:58+00:00 2026-06-16T22:29:58+00:00

For an experimenting project I’am struggling with a service. The client is an ASP.NET

  • 0

For an experimenting project I’am struggling with a service. The client is an ASP.NET MVC 4 and the service will be build with WCF. For now all the systems are in a trusted subsystem so SSL/certificates is not necessarily.

The problem I’am currently dealing with is: Is het possible when I create a new GenericIdentity like:

IIdentity newIdentity = new GenericIdentity("Test", "Custom authentication");
string[] newRoles = { "TestRole" };
IPrincipal testPrincipal = new GenericPrincipal(newIdentity, newRoles);
Thread.CurrentPrincipal = testPrincipal;

It is possible to have the created user when I’am on the WCF service calling the following code:

ServiceSecurityContext.Current.WindowsIdentity;

Or

ServiceSecurityContext.Current.PrimaryIdentity;

Or

Thread.CurrentPrinicpal;

I get the user which I created in the client? Or do I have to write a WCF extensibility for this?

I’m currently using a WsHttpBinding and security mode Transport and clientCredentialType: Windows. Maybe something wrong about the configuration?

  • 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-16T22:30:00+00:00Added an answer on June 16, 2026 at 10:30 pm

    I discovered to achieve this automatically in WCF that you must specify a certificate…

    In the messages that are sent to the WCF service I created a few properties with the information in the datacontracts that is necessary to create a GenericPrinicpal (in this the username en the roles). Because I have an trusted subsystem I don’t want to authenticate the user on each WCF-service (to much overhead for my scenario). See also Trusted subsystem

    With this I created a WCF extension that implemented a parameter inspector and with reflection I set the credentials from the CurrentPrincipal in the specified properties of the contract. For more information about parameter inspectors and how to apply it

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

Sidebar

Related Questions

I am currently experimenting with dynamically loaded areas with ASP.NET MVC 3 RC. I've
Does anyone know of a way to start ASP.NET MVC 4 project without including
I've been experimenting with ASP.Net MVC, and have come across a problem that is
Currently I have an Area in my ASP.NET MVC 2 project call 'API', which
The project is a default ASP.net Website built in vs 2010. I am new
I've just started experimenting with CodeContracts in .NET 4 on an existing medium-sized project,
I'm currently experimenting with EJB3 as a prestudy for a major project at work.
I was experimenting jMock as my mocking framework for my project. I came into
I'm experimenting with Protocol Buffers in an existing, fairly vanilla Maven 2 project. Currently,
For a C# project I'm experimenting with ffmpeg to extract a .wav file from

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.