473,405 Members | 2,185 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Intranet

Hi,
I am developing a local intranet application and will be using Windows authentication
Dot net provides code access security and role-based security I am not very sure how to use them. On the intranet there are links, which a certain group of users can use. How do I implement such a scenario using the security provided by the dot net framework? Can anyone guide on how to implement in dot net

Than
Prasad

Jul 21 '05 #1
1 1849
Hi

The description of your solution does not contain enough details to provide the exact security design of your application. I am going to give you the short overview, but please even if this completely helps you, BE SURE THAT YOU REALY UNDERSTAND WHAT YOU DO

• Assuming that your intranet application I written in ASP.Net or it is ASP Web Service, set the directory security IIS manager on windows authentication. Be sure that anonymous is not checked. This forces the IIS to retrieve an access denied on the first client’s request. The client must be able to authenticate by using NTLM. By using of NTFS you can set wanted permissions

• Then in the web.config of your application set following tags

<authentication mode="Windows" /><identity impersonate="true"/

• If your client is IE browser you do not have to do anything else to be sure that nobody out of specified windows group can access the site

• But, this is often not enough. Additionally you can provide much more granularity by using of CAS if required. The CAS allows you to define the role base security (not only). For example if your solution provides some Web Service you can protect your methods as shown bellow

[ WebMethod(Description="Retrieves the appointment data", EnableSession=false)
[PrincipalPermissionAttribute(SecurityAction.Demand ,
Role = "SomeRole")
public void GetServiceAppointment(string ServiceId

â€
Additionally you have to provide a mechanism, which maps the windows user (Windows Identity established by impersonation (see above)) to the specific role
This can be done in Global.Cs in the method Application_AcquireRequestState

String[] roles = somefunctionof(Thread.CurrentPrincipal.Identity.Na me
GenericIdentity MyIdentity = new GenericIdentity(Thread.CurrentPrincipal.Identity.N ame)
GenericPrincipal MyPrincipal = new GenericPrincipal(MyIdentity, roles)
Thread.CurrentPrincipal = MyPrincipal;

• If you do not use the browser at the client side there are generally two ways to provide credentials
If you can force the user to eneter the user name and password do following
System.Net.ICredentials icred = new System.Net.NetworkCredential(m_User,m_Pwd,m_Domain )

Much better way is to use the currently cached windows credentials
m_ System.Net.ICredentials icred = System.Net.CredentialCache.DefaultCredentials
Sorry if this is not enough, but the security is not something you cannot implement in few minutes. One good solution provides a good security concept. It is not only enough that your application just properly runs. It is also VERY IMPORTANT that your application runs secured. I propose you search for more information in MSDN following keywords

PrincipalPermissionAttribute, impersonation, web.config, NTLM, DefaultCredentials, Credentials â€
Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: HGJS | last post by:
Hi, I want to place a piece of JavaScript at the top of my page/s that wil tell all links on that page to open in certain target windows dependin on the hostname. Suppose the intranet address...
0
by: Chad A. Beckner | last post by:
I am starting to work on implementing ASP.NET (using VS.NET Dev 2003) into our current ASP 3.0 intranet setup. We have several (say 15 - 20) "applications" that are run within our intranet, which...
6
by: contributions | last post by:
I have an access database on our intranet which when a link is clicked to open it the user is prompted with "Would you like to open the file or save it to your computer?". I would like this option...
4
by: Darko Konrad | last post by:
hi guys, i'm about to build an companies intranet portal and i saw on couple of pages that there has been an intranet SK available for VS 2005 beta. In my version of VS2005 i cannot find it any...
6
by: boriq | last post by:
Hallo, I created a project with more that 1000 different pictures in it. The project website is divided into more subpages. Problem is that these pages (pictures) are not cached on local...
1
by: SoulTek | last post by:
Hi All I'm reposting this in the correct forum I originally thought it to be an IIS issue. Here's the original Thread Ok here goes. I have inherrited a local intranet site at a company I'm...
9
by: =?Utf-8?B?bnV1dHV1ZG5ldA==?= | last post by:
We want to use allready written C sharp programs for our asp.net applications. The idea is that we write a program ONCE and use this same EXACT logic for our internet apps. Everything will run on...
8
by: Bruno Barros | last post by:
Hey there. I'm currently working on an intranet, and would like to know how I can get the windows usernames of the visitors. You can get their IP with $_SERVER; But what about their Windows...
3
by: james | last post by:
WATYF <WATYF1@gmail.comwrote in news:eb43eb6a-afaa-4e39-ac0b-850afdb6d1e4@r66g2000hsg.googlegroups.com: It gets complicated. First, a reference:...
0
by: Mark112 | last post by:
Hi I am attempting to restore the search feature that was created by an external company using the indexing service for our intranet. the intranet is located locally at each of our offices. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.