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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:53:28+00:00 2026-05-11T14:53:28+00:00

I have a number of services that will be running under the security context

  • 0

I have a number of services that will be running under the security context of NT Authority\System as a Windows service (the services are NetTCP-based). There are six groups stored in Active Directory that will be allowed to access these services:

Users Agents Approvers Administrators (three levels of admins)

I know I can get the user who is connecting to the service using ServiceSecurityContext.Current.WindowsIdentity.Name.

What I need to do is validate in a business layer that the user context being passed in is able to access the particular service though, and I’d like it to follow an older application my company supports that uses PrincipalPermission passing it a role and using the Demand() method to ensure access.

I guess my initial question is, if I pass PrincipalPermission the ServiceSecurityContext username and the associated role (group), will it automatically know to hit Active Directory behind the scenes since the service is running under the context of an AD account on the same domain? Or is there something special I should do?

  • 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. 2026-05-11T14:53:29+00:00Added an answer on May 11, 2026 at 2:53 pm

    Right, when you demand a role, it’ll call IPrincipal.IsInRole. This will use whatever implementation the principal has. So, if it’s set to Windows, it’ll do all the work to hit AD.

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

Sidebar

Related Questions

I have a Windows Service that performs a number of periodic activities, and I
I have a Windows service that has a number of threads that all need
I have a WCF service XYZ that will be deployed on a number of
I have a large number of C# WCF services that are being called by
I have created a line chart using Reporting Services that charts the number of
I have an application that makes use of/consumes services from a number of external
I have a Windows Service written in Delphi which runs a number of programs.
I have a web application running in a GlassFish 3.1 service on Windows 7
We have a number of services (mostly console applications) running across several remote computers.
We have a service that opens several HttpWebRequests. It ran fine under 3.0 until

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.