469,929 Members | 1,575 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,929 developers. It's quick & easy.

Mindboogling security problems

I need to add a login front end to an existing website. No big deal ????

VS 2005 / Vista / II7 / SQL Express

Well I go into the security and add a welcome page and a login page. Real
easy and the .Net Config tool allows the changing of security and creation
of users etc. Again real easy.

Tested in VS and all works. Close VS and attempt from the internet. I then
get "cannot open user default database. Login failed". I know I am using
correct userid / password.

What gives. So I go back to VS and all is good. Problem is that users
can't run from VS.

???

Lloyd Sheen

Apr 24 '07 #1
3 1159
Sounds like asp.net runs as different accounts
(in the VS internal server and on the internet).

Save the following page to your application directory and run it,
both from inside VS 2005 and from the internet.

identity.aspx:
------------------
<%@ Page Language="VB" %>
<%@ Import NameSpace = System.Security.Principal %>
<script runat="server">
Sub Page_Load()
Dim tmp As String = WindowsIdentity.GetCurrent.Name()
Label1.Text = tmp
End Sub
</script>
<html>
<head>
<title>What account is ASP.NET running as ?</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" Runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
-----------

If that file returns different accounts depending on where it's run from,
adjust the access permissions accordingly.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Lloyd Sheen" <a@b.cwrote in message news:17**********************************@microsof t.com...
>I need to add a login front end to an existing website. No big deal ????

VS 2005 / Vista / II7 / SQL Express

Well I go into the security and add a welcome page and a login page. Real easy and the .Net
Config tool allows the changing of security and creation of users etc. Again real easy.

Tested in VS and all works. Close VS and attempt from the internet. I then get "cannot open user
default database. Login failed". I know I am using correct userid / password.

What gives. So I go back to VS and all is good. Problem is that users can't run from VS.

???

Lloyd Sheen


Apr 24 '07 #2

"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:u5**************@TK2MSFTNGP02.phx.gbl...
Sounds like asp.net runs as different accounts
(in the VS internal server and on the internet).

Save the following page to your application directory and run it,
both from inside VS 2005 and from the internet.

identity.aspx:
------------------
<%@ Page Language="VB" %>
<%@ Import NameSpace = System.Security.Principal %>
<script runat="server">
Sub Page_Load()
Dim tmp As String = WindowsIdentity.GetCurrent.Name()
Label1.Text = tmp
End Sub
</script>
<html>
<head>
<title>What account is ASP.NET running as ?</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" Runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
-----------

If that file returns different accounts depending on where it's run from,
adjust the access permissions accordingly.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Lloyd Sheen" <a@b.cwrote in message
news:17**********************************@microsof t.com...
>>I need to add a login front end to an existing website. No big deal ????

VS 2005 / Vista / II7 / SQL Express

Well I go into the security and add a welcome page and a login page.
Real easy and the .Net
Config tool allows the changing of security and creation of users etc.
Again real easy.

Tested in VS and all works. Close VS and attempt from the internet. I
then get "cannot open user
default database. Login failed". I know I am using correct userid /
password.

What gives. So I go back to VS and all is good. Problem is that users
can't run from VS.

???

Lloyd Sheen


Thanks Juan,

I get different values as you suspected. I am in Vista with II7 and
have no idea how to change the access permissions.

Lloyd

Apr 24 '07 #3
re:
I get different values as you suspected.
Yup, that seemed like a likely cause.

re:
I am in Vista with II7 and have no idea how to change the access permissions.
I'm not using Vista, but the process should be similar to Windows XP or Windows Server:

You open the Windows Explorer ( it may have a different name in Vista )
and right-click the directory where the files are located in.

That will bring up a context menu from which you can select the security options.

From there, you should be able to add whichever account came up when
you ran the file from the internet, so you can give it at least read access.

Check it out. If you need additional help, post back.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Lloyd Sheen" <a@b.cwrote in message news:7B**********************************@microsof t.com...
>
"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:u5**************@TK2MSFTNGP02.phx.gbl...
>Sounds like asp.net runs as different accounts
(in the VS internal server and on the internet).

Save the following page to your application directory and run it,
both from inside VS 2005 and from the internet.

identity.aspx:
------------------
<%@ Page Language="VB" %>
<%@ Import NameSpace = System.Security.Principal %>
<script runat="server">
Sub Page_Load()
Dim tmp As String = WindowsIdentity.GetCurrent.Name()
Label1.Text = tmp
End Sub
</script>
<html>
<head>
<title>What account is ASP.NET running as ?</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" Runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
-----------

If that file returns different accounts depending on where it's run from,
adjust the access permissions accordingly.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Lloyd Sheen" <a@b.cwrote in message news:17**********************************@microsof t.com...
>>>I need to add a login front end to an existing website. No big deal ????

VS 2005 / Vista / II7 / SQL Express

Well I go into the security and add a welcome page and a login page. Real easy and the .Net
Config tool allows the changing of security and creation of users etc. Again real easy.

Tested in VS and all works. Close VS and attempt from the internet. I then get "cannot open
user
default database. Login failed". I know I am using correct userid / password.

What gives. So I go back to VS and all is good. Problem is that users can't run from VS.

???

Lloyd Sheen


Thanks Juan,

I get different values as you suspected. I am in Vista with II7 and have no idea how to change
the access permissions.

Lloyd

Apr 24 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Julien Buratto | last post: by
reply views Thread by Ken in Melbourne Australia | last post: by
4 posts views Thread by Lorenzo | last post: by
28 posts views Thread by grahamd | last post: by
116 posts views Thread by Mike MacSween | last post: by
3 posts views Thread by mar10 | last post: by
7 posts views Thread by Magdelin | last post: by
15 posts views Thread by himilecyclist | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.