473,569 Members | 2,406 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1863
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

<authenticati on mode="Windows" /><identity impersonate="tr ue"/

• 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(Descr iption="Retriev es the appointment data", EnableSession=f alse)
[PrincipalPermis sionAttribute(S ecurityAction.D emand,
Role = "SomeRole")
public void GetServiceAppoi ntment(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_Acq uireRequestStat e

String[] roles = somefunctionof( Thread.CurrentP rincipal.Identi ty.Name
GenericIdentity MyIdentity = new GenericIdentity (Thread.Current Principal.Ident ity.Name)
GenericPrincipa l MyPrincipal = new GenericPrincipa l(MyIdentity, roles)
Thread.CurrentP rincipal = 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.ICre dentials icred = new System.Net.Netw orkCredential(m _User,m_Pwd,m_D omain)

Much better way is to use the currently cached windows credentials
m_ System.Net.ICre dentials icred = System.Net.Cred entialCache.Def aultCredentials
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

PrincipalPermis sionAttribute, impersonation, web.config, NTLM, DefaultCredenti als, Credentials â€
Jul 21 '05 #2

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

Similar topics

1
1848
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 is http://intranet so this means that the hostname is "intranet" right? If I want all intranet page links to open in the same window but al other...
0
1476
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 leads me to the following questions: 1. I currently use an ISAPI filter to "force" all pages to run through a page called site_template.asp. ...
6
2769
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 bypassed as some users become confused at this stage! Also, is there a way to set the database to open within the browser (IE6) in the same way...
4
5137
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 more and on asp.net site neither. since i saw that the portal was designed using webparts it seemed very usable for pusposes. anyone knows, where...
6
1967
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 harddisc and loading time through the intranet is very long. For example: When I click on a link to subpage1 all the pictures from subpage1 are loaded in...
1
1696
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 outsourced to. It has been working fine for some time but three weeks ago stopped accepting certain input from users on spacific pages. These...
9
1467
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 the same server but we will have two types of clients 1. web based, 2. intranet based. Is this possible? If so, what is it called in Microsoft speak?...
8
16658
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 Username? Is there any way of doing so? Through the Intranet?
3
3132
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: http://msdn.microsoft.com/en-us/library/cb6t8dtz(VS.80).aspx You might also try a:
0
1717
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 search isn't working on our 2 newest servers at 2 of our branches - Windows Standard 2008 sp2- using IIS 7. The search page is an aspx page. I have the...
0
7926
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7678
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7982
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5222
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3656
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3644
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1226
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.