473,386 Members | 1,748 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,386 software developers and data experts.

security

Hello, All!

How can I check if I have access to specific network resource?

Or, having user's domain name and password check if he or she has access to
network resource?

Thanks.
Nov 16 '05 #1
9 1688

"ivang" <iv**@ciklum.net> wrote in message
news:OL**************@TK2MSFTNGP10.phx.gbl...
Hello, All!

How can I check if I have access to specific network resource?

Or, having user's domain name and password check if he or she has access
to
network resource?

Thanks.

Not sure what are you calling a network resource?
If it's a remote file server, try to use the resource (fi. open a file) and
catch the "access denied" exception just like you do for a local file.

Willy.
Nov 16 '05 #2
Hello, Willy!

Thanks for reply.

Yes, it's file server. But i can't check access using file access functions,
this doesn't work when I use impersonation feature (impersonated tokens
doesn't have access to network shares at all).

WDM> "ivang" <iv**@ciklum.net> wrote in message
WDM> news:OL**************@TK2MSFTNGP10.phx.gbl...
??>> Hello, All!
??>>
??>> How can I check if I have access to specific network resource?
??>>
??>> Or, having user's domain name and password check if he or she has
??>> access to network resource?
??>>
??>> Thanks.
??>>
WDM> Not sure what are you calling a network resource?
WDM> If it's a remote file server, try to use the resource (fi. open a
WDM> file) and catch the "access denied" exception just like you do for a
WDM> local file.
With best regards, ivang. E-mail: iv************@hotmail.com
Nov 16 '05 #3

"ivang" <iv************@hotmail.com> wrote in message
news:ea**************@TK2MSFTNGP15.phx.gbl...
Hello, Willy!

Thanks for reply.

Yes, it's file server. But i can't check access using file access
functions,
this doesn't work when I use impersonation feature (impersonated tokens
doesn't have access to network shares at all).


No they dont, but if you specify the correct logontype when calling
LogonUser (NETWORK_CLEARTEXT) you will get a direct token with network
access privileges!
If you're like me and don't like impersonation, you simply have to establish
a network logon session (use record) using the "net use" command (from the
command line a logon script), or by calling Win32 API NetUseAdd through
PInvoke.

Willy.
Nov 16 '05 #4
Hello, Willy!
You wrote on Wed, 15 Dec 2004 14:15:38 +0100:

WDM> No they dont, but if you specify the correct logontype when calling
WDM> LogonUser (NETWORK_CLEARTEXT) you will get a direct token with network
WDM> access privileges!
Will this api work under asp.net process account on windows servers lower
than 2003?

WDM> If you're like me and don't like impersonation, you simply have to
WDM> establish a network logon session (use record) using the "net use"
WDM> command (from the command line a logon script), or by calling Win32
WDM> API NetUseAdd through PInvoke.
I'm not sure this will be fast enough to map different network share for
each function call :(
With best regards, ivang. E-mail: iv************@hotmail.com
Nov 16 '05 #5

"ivang" <iv************@hotmail.com> wrote in message
news:u4**************@TK2MSFTNGP11.phx.gbl...
Hello, Willy!
You wrote on Wed, 15 Dec 2004 14:15:38 +0100:

WDM> No they dont, but if you specify the correct logontype when calling
WDM> LogonUser (NETWORK_CLEARTEXT) you will get a direct token with
network
WDM> access privileges!
Will this api work under asp.net process account on windows servers lower
than 2003?
*** No, on W2K "LogonUser" can only be called by users having "Act as part
of the Operating System" privilege, by default only SYSTEM has this
privilege is, that means asp.net should run as "Localsystem" .
This restriction does not exists any longer on XP and higher.
WDM> If you're like me and don't like impersonation, you simply have to
WDM> establish a network logon session (use record) using the "net use"
WDM> command (from the command line a logon script), or by calling Win32
WDM> API NetUseAdd through PInvoke.
I'm not sure this will be fast enough to map different network share for
each function call :(

*** You shouldn't use this from asp.net, use impersonation instead.
See inline ***

Willy.
Nov 16 '05 #6
Hello, Willy!
You wrote on Wed, 15 Dec 2004 18:26:29 +0100:
WDM> *** No, on W2K "LogonUser" can only be called by users having "Act as
WDM> part of the Operating System" privilege, by default only SYSTEM has
WDM> this privilege is, that means asp.net should run as "Localsystem" .
WDM> This restriction does not exists any longer on XP and higher.
This is a real problem. We still have clients with Windows 2000 Server...

WDM>>> If you're like me and don't like impersonation, you simply have to
WDM>>> establish a network logon session (use record) using the "net use"
WDM>>> command (from the command line a logon script), or by calling Win32
WDM>>> API NetUseAdd through PInvoke.
??>> I'm not sure this will be fast enough to map different network share
??>> for each function call :(
WDM> *** You shouldn't use this from asp.net, use impersonation instead.
WDM> See inline ***
In asp.net impersonation network credentials are not delegated by default
;( Of couse I can enable Kerberos delegation for application server but we
not always have access to domain controller.

With best regards, ivang. E-mail: iv************@hotmail.com
Nov 16 '05 #7

"ivang" <iv************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hello, Willy!
You wrote on Wed, 15 Dec 2004 18:26:29 +0100:
WDM> *** No, on W2K "LogonUser" can only be called by users having "Act as
WDM> part of the Operating System" privilege, by default only SYSTEM has
WDM> this privilege is, that means asp.net should run as "Localsystem" .
WDM> This restriction does not exists any longer on XP and higher.
This is a real problem. We still have clients with Windows 2000 Server...

WDM>>> If you're like me and don't like impersonation, you simply have to
WDM>>> establish a network logon session (use record) using the "net use"
WDM>>> command (from the command line a logon script), or by calling Win32
WDM>>> API NetUseAdd through PInvoke.
??>> I'm not sure this will be fast enough to map different network share
??>> for each function call :(
WDM> *** You shouldn't use this from asp.net, use impersonation instead.
WDM> See inline ***
In asp.net impersonation network credentials are not delegated by default
;( Of couse I can enable Kerberos delegation for application server but we
not always have access to domain controller.

With best regards, ivang. E-mail: iv************@hotmail.com

I know this is a problem on W2K but there is no other solution as to run the
asp.net worker process as "LocalSystem" and impersonate using "LogonUser"
with a CLEARTEXT network logon type.
Forget about delegation, it doesn't work in an internat scenario.

Willy.
Nov 16 '05 #8
Use the WindowsIdentity class and obtain the credentials. The check for
the role of the user and permissions through IsInRole property of the
WindowsIdentity object. WindowsIdentity is in
System.Security.Permissions or System.Security.Principal. I do not
remember exactly.

with regards,
J.V.Ravichandran
- http://www.geocities.com/
jvravichandran
- http://www.411asp.net/func/search?
qry=Ravichandran+J.V.&cob=aspnetpro
- http://www.southasianoutlook.com
- http://www.MSDNAA.Net
- http://www.csharphelp.com
- http://www.poetry.com/Publications/
display.asp?ID=P3966388&BN=999&PN=2
- Or, just search on "J.V.Ravichandran"
at http://www.Google.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #9
Did you read OP's question? Your answer has nothing to do with access
permissions to network resources.
Also, WindowsIdentity doesn't obtain credentials (domainname, username and
password), it only obtains the identity of a user provided he's an
authenticated windows user .
Willy.

"Ravichandran J.V." <jv************@yahoo.com> wrote in message
news:eK**************@TK2MSFTNGP15.phx.gbl...
Use the WindowsIdentity class and obtain the credentials. The check for
the role of the user and permissions through IsInRole property of the
WindowsIdentity object. WindowsIdentity is in
System.Security.Permissions or System.Security.Principal. I do not
remember exactly.

with regards,
J.V.Ravichandran
- http://www.geocities.com/
jvravichandran
- http://www.411asp.net/func/search?
qry=Ravichandran+J.V.&cob=aspnetpro
- http://www.southasianoutlook.com
- http://www.MSDNAA.Net
- http://www.csharphelp.com
- http://www.poetry.com/Publications/
display.asp?ID=P3966388&BN=999&PN=2
- Or, just search on "J.V.Ravichandran"
at http://www.Google.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #10

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

Similar topics

2
by: robert | last post by:
well, talk about timely. i'm tasked to implement a security feature, and would rather do so in the database than the application code. the application is generally Oracle, but sometimes DB2. ...
116
by: Mike MacSween | last post by:
S**t for brains strikes again! Why did I do that? When I met the clients and at some point they vaguely asked whether eventually would it be possible to have some people who could read the data...
4
by: Ashish | last post by:
Hi Guys I am getting the following error while implementing authentication using WS-security. "Microsoft.Web.Services2.Security.SecurityFault: The security token could not be authenticated...
0
by: prithvi g via .NET 247 | last post by:
Hi I am a newbie to .NET remoting, I am trying to implementauthorization using SSPI example provided by Michael Barnett. Ihave included the required dll(Microsoft.Samples.Security.SSPI.dll...
1
by: Earl Teigrob | last post by:
Background: When I create a ASP.NET control (User or custom), it often requires security to be set for certain functionality with the control. For example, a news release user control that is...
7
by: Magdelin | last post by:
Hi, My security team thinks allowing communication between the two IIS instances leads to severe security risks. Basically, we want to put our presentation tier on the perimeter network and the...
0
by: Jay C. | last post by:
Jay 3 Jan. 11:38 Optionen anzeigen Newsgroups: microsoft.public.dotnet.framework.webservices.enhancements Von: "Jay" <p.brunm...@nusurf.at> - Nachrichten dieses Autors suchen Datum: 3 Jan...
3
by: Velvet | last post by:
I ran FxCop on one of the components for my web site and the security rules what me to add " tags like the ones listed below: This breaks my ASP.NET application. So my question is,...
1
by: Jeremy S. | last post by:
..NET's code Access Security enables administrators to restrict the types of things that a .NET application can do on a local computer. For example, a ..NET Windows Forms application can be...
2
by: Budhi Saputra Prasetya | last post by:
Hi, I managed to create a Windows Form Control and put it on my ASP .NET page. I have done the suggestion that is provided by modifying the security settings. From the stack trace, I would...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.