SQL Errror - Token-based validation failed

Soo… Long time no write…

A quick project was assigned to me and two other guys at work the other week – one of those quick 2-3 day projects, the ones were speed is paramount. Quality can be worked on after release… Sooo.. 3 parts, 3 of us, we split it 3 ways and all was good – one on database duty (using LINQ to SQL), one on UI (Adobe Flash 10) and me, on WCF service…

All was going well, the database was up and running, I was using the libraries to interact it with it without any problems, then we published the service to our dev webserver and attempted to connect to it. Nothing.

Ok, attempt to connect the UI to the service when hosted through VS2008 – no problem…

The dev service could see the database, no problems there, so we connected to the database itself and perused the logs and found this:

Date Source Severity Message
11/12/2009 15:05:44 Logon Unknown Login failed for user ‘USERNAME'. Reason: Token-based server access validation failed with an infrastructure error. Check for previous errors. [CLIENT:]
11/12/2009 15:05:44 Logon Unknown Error: 18456<c/> Severity: 14<c/> State: 11.


Where the ‘USERNAME’ was the machine name of the development server.. So it looked like the service was attempting to connect to the database as the machine. But the connection string was using a SQL User, not integrated security…

<add name="OT.Properties.Settings.DbConnectionString" 
     providerName="System.Data.SqlClient" />

as you can see – it’s just using the default settings from a LINQ to SQL DBML file.. and it turns out that this is the underlying issue. By adding a new connection string:

<add name="TheDb" 
     providerName="System.Data.SqlClient" />

and then hooking up the database layer to use it the problem was solved.

Print | posted @ Saturday, November 28, 2009 3:28 AM

Comments on this entry:

Gravatar # W3c Validation
by w3cvalidation at 4/15/2010 9:51 AM

Nice information, I really appreciate the way you presented.Thanks for sharing..

Post A Comment