Showing posts with label authentication. Show all posts
Showing posts with label authentication. Show all posts

Thursday, March 29, 2012

Error when trying to log in to SQL server

I've just finished developing a web app, which works fine on my PC, running IIS locally. It uses windows authentication and a trusted connection to retrieve data from SQL server. So far so routine. When I deploy the app to my live server, it returns the error:

Login failed for user '\'

The stack trace seems to indicate that it's at the point where the app tries to retrieve data that the error occurs. I proved this by changing my connection string to explicitly define the log on, and it retrieved the data no problem.

I set up a very simple webform with a label on, to return what it thought the user's log on name was, and it returns the correct name.

Any ideas as to why the username isn't being correctly passed to SQL server?Have you made sure the Web Account is a valid user of the SQL Server? If the IIS box and the SQL box are different you have to ensure the user has network rights too.|||Yes, the user (me!) definitely has rights on the SQL server. How come it works locally on my PC, but not on the server?

What network rights do you think I should investigate?

Thanks.|||Sorry I mis-read your original post, I didn't notice that your site was using NT Authentication. So here is my mental checklist:
1. Web Server has access to the Domain server to authenticate the user
2. The Web Server isn't the Domain Server
3. SQL Server security logins knows about the Windows user/user group
4. The SQL Database knows about the Windows user/user group

I mentioned the network security because when you use anon web access the user must have network access to go across machines. That "shouldn't" be an issue here.

Also run SQL Profiler to see if the user is getting set to SQL and then going wrong. Sounds more like its a problem on the web server though, something wrong with the impersonation.|||I'm positive that the user is being authenticated properly on the app, because when I load a simple page with a label which displays the user name, it displays correctly. For some reason this user name isn't getting passed to SQL server correctly.

I tried deploying the application to the box which has the SQL server running, and gess what? It worked. So does this mean that the first box can't access the domain server? Any idea how I can check that?

I'll have a think, and let you know how I get on.

Cheers.|||Hang on, just cause you're using Web Authentication doesn't mean it will impersonate the user onto SQL Server. Do you set the principal security when the user connects?

Check out:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetch03.asp

Error when trying to deploy

I am getting this error when trying to deploy a report. As far as I can see
permissions /Authentication is all ok
A connection could not be made to the report server
http://Servername/ReportServer
Anybody have any ideas of where to start looking?Have you checked the report project properties? Right mouse on your project
and select "Properties" and be sure the TargetServerURL points to the
correct deploy server (i.e. http://hostname/ReportServer).
"PaulM" <PaulM@.discussions.microsoft.com> wrote in message
news:63646412-BB77-438B-9A45-E4723AE5262C@.microsoft.com...
>I am getting this error when trying to deploy a report. As far as I can see
> permissions /Authentication is all ok
> A connection could not be made to the report server
> http://Servername/ReportServer
> Anybody have any ideas of where to start looking?
>|||I was having this same problem on a new PC that I had just setup with .NET
and SQL Reporting. I found that I needed to have the "Bypass proxy server
for local addresses" checkbox checked in my IE browser connection settings.
I found this by comparing to my old PC.
"goodman93" wrote:
> Have you checked the report project properties? Right mouse on your project
> and select "Properties" and be sure the TargetServerURL points to the
> correct deploy server (i.e. http://hostname/ReportServer).
>
> "PaulM" <PaulM@.discussions.microsoft.com> wrote in message
> news:63646412-BB77-438B-9A45-E4723AE5262C@.microsoft.com...
> >I am getting this error when trying to deploy a report. As far as I can see
> > permissions /Authentication is all ok
> >
> > A connection could not be made to the report server
> > http://Servername/ReportServer
> >
> > Anybody have any ideas of where to start looking?
> >
> >
>
>

Wednesday, March 21, 2012

Error when deploying forms authentication sample

Hello

I'm trying to get the forms authentication sample working - I have followed the instructions given in the ReadMe that came with the samples. When I try to browse to localhost/reportserver (on the server), instead of seeing the logon page as expected, I get the following error message:

An internal error occurred on the report server. See the error log for more details. (rsInternalError) Get Online Help

Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

I built the sample in VS 2005, and am using v2 of .net. Reporting services is installed on a windows server 2003 machine.

This has been driving me crazy for a while now. Any help would be greatly appreciated!

Thanks in advance

Dominic

Have a look at this.

http://blog.devstone.com/aaron/archive/2005/03/31/502.aspx

Also, try using www.sysinternals.com filemon and regmon to track down permission issues.

cheers,

Andrew

|||

I am also facing the same problem. Due you get the solution ?I

|||

I was having the same problem. I solved it changing the RSSrvPolicy.config as explained in http://msdn2.microsoft.com/en-us/ms160724.aspx

My particular mistake was in the line Url="C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer\bin\Microsoft.Samples.ReportingServices.CustomSecurity.dll" because I had the path wrong. I corrected that and corrected the problem.

Hope this helps.

The RSSrvPolicy.config that has to be changed:

<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="$CodeGen$/*"
/>
</CodeGroup>
<CodeGroup
class="UnionCodeGroup"
version="1"
Name="SecurityExtensionCodeGroup"
Description="Code group for the sample security extension"
PermissionSetName="FullTrust">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer\bin\Microsoft.Samples.ReportingServices.CustomSecurity.dll"
/>
</CodeGroup>

Monday, March 19, 2012

Error when deploying forms authentication sample

Hello

I'm trying to get the forms authentication sample working - I have followed the instructions given in the ReadMe that came with the samples. When I try to browse to localhost/reportserver (on the server), instead of seeing the logon page as expected, I get the following error message:

An internal error occurred on the report server. See the error log for more details. (rsInternalError) Get Online Help

Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

I built the sample in VS 2005, and am using v2 of .net. Reporting services is installed on a windows server 2003 machine.

This has been driving me crazy for a while now. Any help would be greatly appreciated!

Thanks in advance

Dominic

Have a look at this.

http://blog.devstone.com/aaron/archive/2005/03/31/502.aspx

Also, try using www.sysinternals.com filemon and regmon to track down permission issues.

cheers,

Andrew

|||

I am also facing the same problem. Due you get the solution ?I

|||

I was having the same problem. I solved it changing the RSSrvPolicy.config as explained in http://msdn2.microsoft.com/en-us/ms160724.aspx

My particular mistake was in the line Url="C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer\bin\Microsoft.Samples.ReportingServices.CustomSecurity.dll" because I had the path wrong. I corrected that and corrected the problem.

Hope this helps.

The RSSrvPolicy.config that has to be changed:

<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="$CodeGen$/*"
/>
</CodeGroup>
<CodeGroup
class="UnionCodeGroup"
version="1"
Name="SecurityExtensionCodeGroup"
Description="Code group for the sample security extension"
PermissionSetName="FullTrust">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer\bin\Microsoft.Samples.ReportingServices.CustomSecurity.dll"
/>
</CodeGroup>

Error when deploying forms authentication sample

Hello

I'm trying to get the forms authentication sample working - I have followed the instructions given in the ReadMe that came with the samples. When I try to browse to localhost/reportserver (on the server), instead of seeing the logon page as expected, I get the following error message:

An internal error occurred on the report server. See the error log for more details. (rsInternalError) Get Online Help

Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

I built the sample in VS 2005, and am using v2 of .net. Reporting services is installed on a windows server 2003 machine.

This has been driving me crazy for a while now. Any help would be greatly appreciated!

Thanks in advance

Dominic

Have a look at this.

http://blog.devstone.com/aaron/archive/2005/03/31/502.aspx

Also, try using www.sysinternals.com filemon and regmon to track down permission issues.

cheers,

Andrew

|||

I am also facing the same problem. Due you get the solution ?I

|||

I was having the same problem. I solved it changing the RSSrvPolicy.config as explained in http://msdn2.microsoft.com/en-us/ms160724.aspx

My particular mistake was in the line Url="C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer\bin\Microsoft.Samples.ReportingServices.CustomSecurity.dll" because I had the path wrong. I corrected that and corrected the problem.

Hope this helps.

The RSSrvPolicy.config that has to be changed:

<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="$CodeGen$/*"
/>
</CodeGroup>
<CodeGroup
class="UnionCodeGroup"
version="1"
Name="SecurityExtensionCodeGroup"
Description="Code group for the sample security extension"
PermissionSetName="FullTrust">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer\bin\Microsoft.Samples.ReportingServices.CustomSecurity.dll"
/>
</CodeGroup>

Error when connecting to SQL Server

Hi

when i tried connecting to SQL Server Express I got this error, be it connecting via Windows Authentication or SQL Authentication. Pls see below for the error message:

===================================

Cannot connect to JOHNSON\SQLEXPRESS.

===================================

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (.Net SqlClient Data Provider)


For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=-1&LinkId=20476


Error Number: -1
Severity: 20
State: 0

Program Location:

at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner, Boolean& failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject, Boolean aliasLookup)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.ValidateConnection(UIConnectionInfo ci, IServerType server)
at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()

wats wrong with my setup? Previously it can connect. till i upgraded to SQL Server 2005 then uninstall my SQL Server 2005 then it become like tt....

what shld i do?

Pls advise.

Thanks

Johnson

Did you enable remote connections ? This is disabled by default. See the Screencast on my site for more information.

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||

Hi,

THanks for the reply but when i look into ur screencast and followed the steps to enable remote connection, I got the below error when try to click on the Surface Area Configureation.

"===================================

No SQL Server 2005 components were found on the specified computer. Either no components are installed, or you are not an administrator on this computer. (SQLSAC)


Program Location:

at Microsoft.SqlSac.MainPanel.FormServicesAndProtocols.ProcessClassConstructor()"

By the way y do i nd to enable remote connection when i am trying to connect to only my local SQLExpress?

I am using SQL Express and not SQL Server 2005.

Thanks

Johnson

|||Are you trying to configure the local computer ?|||

ya i m trying to access my SQL Mobile database using my SQL Server Management Studio Express. But when i tried connecting using SQL Server Management Studio Express to my local machine, I got thrown the error.

As mentioned I previously upgraded my SQL Server Express to SQL Server 2005. Thereafter I uninstall my SQL Server 2005 and reinstall ym VS 2005. So i duno is it cos of this. If so, wat shld I do to resolve this?

Can u advise wat's wrong?

Thanks

Johnson

|||

Hi Johnson,

I'm trying to understand what you're really trying to do here because your information is conflicting, maybe you can clarify a bit...

Are you trying to work with SQL Mobile or SQL Express? They are two different products. Do you have SQL Express installed or not? You've claimed that you installed it, then uninstalled it. You can't connect to it if you've uninstalled it. Do you have an entry on your Start menu for Microsoft SQL Server 2005? What is on it?|||

SQL Network Interfaces, error: 26 - Error Locating Server/Instance SpecifiedSQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified

This usually means the application cannot contact your SQL Browser. So, make sure SQL Browser is running and it's firewalled(put sqlbrowser.exe or UDP 1434 into exception).

|||

Hi Thanks..

I resolve the problem already. cos there isnt any SQL Server instance installed Smile

Thanks

Johnson

Friday, March 9, 2012

Error using Windows Authentication in Access

I currently have an Access database connecting to an MSDE back-end running
on the server. The server is running Windows Server 2000. The rest of the
workstations are running Windows XP Home Edition. MSDE is installed in
Mixed mode, and is configured to accept network connections.
When I open Access, I get an error message that looks something like this:
Connection Failed:
Login Failed for user (null). Reason: Not associated with a Trusted
Connection.
I think the problem is that we don't have domains, since we are running XP
Home rather than XP Pro. I can log in just fine in SQL Server
Authentication, but every time Access comes up it gives me this error.
Is there a way to make it so that Access will default to SQL Server
Authentication rather than Windows Authentication? (I am using .mdb if it
matters).
Any help would be appreciated.
Thanks,
Chris
Windows Authentication won=B4t work accross computers without a domain
concept (Which XP Home has no idea of)
http://groups.google.de/group/micros...ity/browse_fr=
m/thread/2732c74677dd6a77
"Is there a way to make it so that Access will default to SQL Server
Authentication rather than Windows Authentication? (I am using .mdb if
it
matters). "
You can either use SQL OR Windows Auth.:
http://msdn.microsoft.com/library/de...n-us/adminsql=
/ad_security_47u6.asp
HTH, Jens Suessmeyer.
|||Jens, thanks for the response. I know that I can use Windows Auth. or SQL
Server Auth. I have the server set to SQL Server Authentication by default,
and it works fine. The problem is that when I try to open a form in Access
that has a table on the MSDE back-end as its data source, I get an error
(the same one I mentioned in my original post).
If I understand correctly, when MSDE is set to Mixed mode, it will first
attempt to log you in using your Windows Authentication, and failing that,
will then allow you to log in using SQL Server Authentication.
This seems to be what is happening in Access. The system first tries to log
me in using Windows Auth., which of course won't work because we don't have
domains, so it generates an error. Then, it allows me to log in using SQL
Server Authentication, which works just fine. So, the problem isn't that I
can't login to the database, it's just that I get an error message every
time I try to open the form.
I have been trying to use a connection string to prompt the user for their
Username and Password on startup.
The code for the connection string looks like this:
Dim oConn As New ADODB.Connection
oConn.Properties("Prompt") = adPromptAlways
oConn.Open "Driver={SQL Server};Server=OFFICE-DC;Database=authorDB Linked
Tables 2003 NoSwitchboard
SQL;TABLE=dbo.EntireSpreadsheet;Trusted_Connection =no;"
What this code does is to bring up the SQL Server Login dialog box, which
allows the user to enter their username and password. If they enter their
information incorrectly, they get an error message. If they enter it
correctly, the dialog box disappears.
The problem is that, even if the user enters their username and password
correctly, they will STILL get an error message when they go to open the
form. The only idea I have to explain this is that perhaps the connection
string is not saving their Username and Password.
In any case, I'm really not trying to use Windows Authentication, however
I'm fairly certain that what is generating the error is that Access IS
trying to use Windows Authentication, despite the fact that we don't have
domains.
If anyone has any ideas about how to get around this error (login failed for
user (null) ) I would love to hear them.
Thanks,
Chris
"Jens" <Jens@.sqlserver2005.de> wrote in message
news:1129707071.110729.195090@.g14g2000cwa.googlegr oups.com...
Windows Authentication wont work accross computers without a domain
concept (Which XP Home has no idea of)
http://groups.google.de/group/micros...32c74677dd6a77
"Is there a way to make it so that Access will default to SQL Server
Authentication rather than Windows Authentication? (I am using .mdb if
it
matters). "
You can either use SQL OR Windows Auth.:
http://msdn.microsoft.com/library/de...urity_47u6.asp
HTH, Jens Suessmeyer.
|||How were these tables added to the access database, are these linked
tables ? Were the linked tables generated on a system which used
integrated authentication ? If so ,look in the system tables of access
and see whatr kind of authentication is used in here. Guess you are
trying to open the tables with two different methods,y our own one
(those with the dialog box) uses SQL Server authentication and this
with the linked tqables tries to use Windows Auth.
Jens Suessmeyer.