Showing posts with label page. Show all posts
Showing posts with label page. Show all posts

Friday, March 30, 2012

Login failed for user NT AUTHORITY\NETWORK SERVICE

I have built a web page in visual web developer express and I moved it over to use IIS. I gave NT AUTHORITY\NETWORK SERVICE read and write permissions to the folder and included it in my IIS virtual folder. I can see the login page just fine. I can create a user just fine. I can even access the forgot password page just fine. But if I try to login in I get this stack trace. I can't figure out what more I need to do for NT AUTHORITY\NETWORK SERVICE. Can any one help.

Server Error in '/' Application.

Cannot open user default database. Login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Data.SqlClient.SqlException: Cannot open user default database. Login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[SqlException (0x80131904): Cannot open user default database. Login failed.Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735043 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +84 System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +197 System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +1121 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42 System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +83 System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160 System.Web.UI.WebControls.Login.AttemptLogin() +105 System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

Hi matt,

You have using Integrated Security=SSPI in your connection string. You would have to use: User ID and Password.

Good Coding!

Javier Luna
http://guydotnetxmlwebservices.blogspot.com/

|||

This is a common login failure when the application runs under IIS, and the 'NT AUTHORITY\NETWORK SERVICE' is the account used by IIS6.0. You may take a look at this post:

http://forums.asp.net/thread/1325077.aspx

sql

Login failed for user NT AUTHORITY\LOCAL SERVICE

I just installed the Issue Tracker using .net 1.1 (on my computer). When I try to log in via the login page, I get:

Login failed for user 'NT AUTHORITY\LOCAL SERVICE'

Here is my stack trace info:

SqlException: Login failed for user 'NT AUTHORITY\LOCAL SERVICE'.]
System.Data.SqlClient.ConnectionPool.CreateConnection() +402
System.Data.SqlClient.ConnectionPool.UserCreateRequest() +151
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +386
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
ASPNET.StarterKit.IssueTracker.DataAccessLayer.SQLDataAccessLayer.ExecuteScalarCmd(SqlCommand sqlCmd) +129
ASPNET.StarterKit.IssueTracker.DataAccessLayer.SQLDataAccessLayer.Authenticate(String username, String password) +184
ASPNET.StarterKit.IssueTracker.BusinessLogicLayer.ITUser.Authenticate(String username, String password) +44
ASPNET.StarterKit.IssueTracker.DesktopDefault.Login(Object s, EventArgs e) +84
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292

I have added everyone, asp.net, local service, network service - all full control on the entire folder. Restarted IIS - still can't log in. Please help.

Hi, look at the exception you'll find it is from SQL. So you have to add proper permissions in SQL for the account rather than give control on the folder. Please open SQL Server Management Studio (Enterprise Manager) and go to the SQL instance which you're trying to connect, and explore Security->Logins->right click choose 'New Login'-> choose Windows Authentication and type the Windows account name. Remember to give sufficient permissions to the new added login.|||Thanks for the info. That fixed my issue.|||

What exactly should those permissions be, Read-only, owner, read/write.. what?

Thanks

|||

thelane:

What exactly should those permissions be, Read-only, owner, read/write.. what?

Thanks

The permissions I mean here is permissions in SQL, such as SELECT/INSERT/UPDATE on tables, CREATE DATABASES, EXECUTE stored procedures, and so onSmile You can take a look at this link:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_security_94dv.asp

Monday, March 19, 2012

Login failed

I have VS2005 Beta 2

I created a very simple Web Site that has a Login page and a Default Page

I installed MSDE so that I can use a SQL 2000 database

I ran C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\aspnet_regsql.exe
to create a database in the MSSQLSERVER for user info.

My Web.config file looks like:

<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=localhost;Initial Catalog=myDataBase;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<compilation debug="false">
<assemblies>
<add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
<authorization>
<deny users="?"></deny>
</authorization>
<authentication mode="Forms"/>
</system.web>
</configuration>


I have a Global.asax file containing:

void Application_Start(Object sender, EventArgs e) {
// always create bob and alice as users if they are not present
// so you can login and we can avoid dealing with admin
//
MembershipCreateStatus status;
if (Membership.FindUsersByName("bob").Count == 0)
Membership.CreateUser("bob", "pass@.word1", "bob@.wingtip.com", "no question", "no answer", true, out status);
if (Membership.FindUsersByName("alice").Count == 0)
Membership.CreateUser("alice", "pass@.word1", "alice@.wingtip.com", "no question", "no answer", true, out status);
}

When open the web site from the File System in VS2005 everything runs fine.

When I copy the Web site to a virtual directory set up in IIS and the open the web site using Local IIS in VS2005 I get:

Cannot open database "myDataBase" requested by the login. The login failed.
Login failed for user 'BARBARA\ASPNET'.


You use integrated security to connect to the database and when testing local in VS2005 it will use the currently logged on user running VS2005. Most likely that is your user account and it has access to the database.

The error message indicates you are trying to logon to the database with BARBARA\ASPNET user and that is the user setup to run the application in IIS. You could either change this to be another user that has access to the database needed, under directory security in IIS, or give the user BARBARA\ASPNET access to the database.|||Thanks for your reply - I don't have that much experience with this stuff -

Could you please tell me how I can go about giving BARBARA\ASPNET access to the database? I don't know about changing the user that is accessing the database in IIS. BARBARA is the name of the computer and ASPNET is the user that was created on the computer when all this stuff was loaded. Do I have to change the database server to use mixed security?

Is it a user that has to be set up for the server or for the database? In any case, I don't really know how to do this. Any direction would be appreciated.

thanks|||You might want to have a look at 3rd party tools to adminstrate MSDE.

You can do it directly in a query also.

exec sp_grantlogin 'BARBARA\ASPNET'
go
use myDataBase
go
exec sp_grantdbaccess 'BARBARA\ASPNET', 'ASPNET'
go
exec sp_addrolemember 'public', 'ASPNET'

This assumes that the group public has the proper permissions in the database. You could use dbo instead of public then the ASPNET user will be acting as database owner.

|||okay thank you very much - that gives me a direction

Login failed

I have VS2005 Beta 2

I created a very simple Web Site that has a Login page and a Default Page

I installed MSDE so that I can use a SQL 2000 database

I ranC:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\aspnet_regsql.exe
to create a database in the MSSQLSERVER for user info.

My Web.config file looks like:

<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=localhost;Initial Catalog=myDataBase;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<compilation debug="false">
<assemblies>
<add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
<authorization>
<deny users="?"></deny>
</authorization>
<authentication mode="Forms"/>
</system.web>
</configuration>


I have a Global.asax file containing:

void Application_Start(Object sender, EventArgs e) {
// always create bob and alice as users if they are not present
// so you can login and we can avoid dealing with admin
//
MembershipCreateStatus status;
if (Membership.FindUsersByName("bob").Count == 0)
Membership.CreateUser("bob", "pass@.word1", "bob@.wingtip.com", "no question", "no answer", true, out status);
if (Membership.FindUsersByName("alice").Count == 0)
Membership.CreateUser("alice", "pass@.word1", "alice@.wingtip.com", "no question", "no answer", true, out status);
}

When open the web site from the File System in VS2005 everything runs fine.

When I copy the Web site to a virtual directory set up in IIS and the open the web site using Local IIS in VS2005 I get:

Cannot open database "myDataBase" requested by the login. The login failed.
Login failed for user 'BARBARA\ASPNET'.


You use integrated security to connect to the database and when testing local in VS2005 it will use the currently logged on user running VS2005. Most likely that is your user account and it has access to the database.

The error message indicates you are trying to logon to the database with BARBARA\ASPNET user and that is the user setup to run the application in IIS. You could either change this to be another user that has access to the database needed, under directory security in IIS, or give the user BARBARA\ASPNET access to the database.|||Thanks for your reply - I don't have that much experience with this stuff -

Could you please tell me how I can go about giving BARBARA\ASPNET access to the database? I don't know about changing the user that is accessing the database in IIS. BARBARA is the name of the computer and ASPNET is the user that was created on the computer when all this stuff was loaded. Do I have to change the database server to use mixed security?

Is it a user that has to be set up for the server or for the database? In any case, I don't really know how to do this. Any direction would be appreciated.

thanks|||You might want to have a look at 3rd party tools to adminstrate MSDE.

You can do it directly in a query also.

exec sp_grantlogin 'BARBARA\ASPNET'
go
use myDataBase
go
exec sp_grantdbaccess 'BARBARA\ASPNET', 'ASPNET'
go
exec sp_addrolemember 'public', 'ASPNET'

This assumes that the group public has the proper permissions in the database. You could use dbo instead of public then the ASPNET user will be acting as database owner.|||okay thank you very much - that gives me a direction

Monday, March 12, 2012

login case senssitive

I would like to have a login page that is case senssitive. Right now the userName field in DB store Example :"John", but it allow the user to log in even if he types "john". Is the any SQL statement that select only if if name match and the case are match?::Is the any SQL statement that select only if if name match and the case are match?

=

I assume you use "Like". "Like" ignores case.

Now- otos - does your request make sense? I mean

::I would like to have a login page that is case senssitive. Right now the userName field in
::DB store Example :"John",

If "John" and "john" are different users, you open pandora's box for people mixing this up.

Our security systems ware case insensitive and store - besides the "DisplayName" also a "UniqueName" (name in lower cases), which triggers a unique constraint.

Having two users that differentiate their name only by casing sounds to me like a terrific bad idea. I can imagine the support calls coming in.|||The reason for case sensitive is because later on in my application i am using the user name and it has to be at certain form.
my select statement is:
"SELECT* FROM[FrenchRoast].[shikozel_db].[Chef] WHERE (([Chef].[Name] = @.Name) AND ([Chef].[Password] = @.password))"

I dont use like.
thank you.help...|||::The reason for case sensitive is because later on in my application i am using the user
::name and it has to be at certain form.

With all respect, this is no rason to make logins case sensitive. All my arguments are true - you willget into trouble with people spelling their name wrong when logging in.

Btw - if this:

::AND ([Chef].[Password] = @.password))"

indicates that you store the password in clear text in the database, then PLEASE get an introduction book on security. Storing the paswords in the database opens you up for a lot of not-funny things, including a tremendous amount of legal liability in case something does go wrong - without any legal defence, as it is gross neglect. Passwords should never ever be stored in the database.|||thank you for your comment. Where should i store passwords? any tutorial or books?|||::Where should i store passwords?

You should never ever store passwords. Look at how modern operating systems do it - they also never store passwords.|||Thona is correct, case sensitive passwords are a bad design and clear text pw's are equally as bad from a security stand point, so I recommend you read up on MD5.

Friday, March 9, 2012

Logical Scan fragmentation ?

Can someone explain this statement ?
"An out of order page is one for which the next page indicated in an IAM is
a different page than the page pointed to by the next page pointer in the
leaf page."
Does this mean that DBCC checktable may result in some allocation errors ?Hi Hassan
No, this is not an error. The IAM indicates the next physical page and the
pointers indicate the next logical page. It just means that the a page is
out of order. :-)
So let's say your table is on page 82, 86 and 95. The IAM would indicate
them in that physical order. But it may be that the first rows in the index
are on page 95 (for example, valus A-G) then the next logical values are on
page 86 (values H - S) and the next are on page 82 (values T - Z). When you
are on page 86, the pointers will say that the next page is 82, but the IAM
will say that the next page is 95. This is just fragmentation, not an
error.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:egCGeILnDHA.1708@.TK2MSFTNGP12.phx.gbl...
> Can someone explain this statement ?
> "An out of order page is one for which the next page indicated in an IAM
is
> a different page than the page pointed to by the next page pointer in the
> leaf page."
> Does this mean that DBCC checktable may result in some allocation errors ?
>|||Read the whitepaper at:
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/sql/maintain/optimize/ss2kidbp.asp
which should explain everything for you.
--
Paul Randal
DBCC Technical Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:egCGeILnDHA.1708@.TK2MSFTNGP12.phx.gbl...
> Can someone explain this statement ?
> "An out of order page is one for which the next page indicated in an IAM
is
> a different page than the page pointed to by the next page pointer in the
> leaf page."
> Does this mean that DBCC checktable may result in some allocation errors ?
>

Monday, February 20, 2012

Logging on with SA account!

I am attempting to connect to SQL7.0 via the SA account via an ASP page and having the message:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'WRIGHT\IUSR_WRIGHT'.
Any ideas?This is the anonymous login that IIS uses. Right click on default web site under Internet Services Manager. Click on properties -> Directory Security tab -> Click Edit under the Anonymous access-> Click Edit under the Anonymous access -- you will see this user name.|||Thanks very much...

so simple when you know how!!