SQL 2000, ASP.NET 2.0 and two servers between :/

M

marek zegarek

Hello!

I know, that was a lot of threads about it, but nothing helps me...
I get user 'null' when i'm trying to access SQL.

My lab:
1) one client station with IE
2) one w2k3 with Sharepoint Portal Server. It contains webpart displaying my
asp.net page
3) one server with IIS that contains my asp.net page (configured as Windows
Authentication only)
4) one server with SQL 2000 database (configured in mixed mode)

User 'null' is between 3 and 4. In webconfig i have this lines for
authentication:
<authentication mode="Windows"/>
<identity impersonate="true" />

SQL connection string is:
<add name="connStr" connectionString="Data Source=srvSQL;Initial
Catalog=MyTestDB;Integrated Security=true;"
ProviderName="System.Data.SqlClient"/>

I'm using datareader to read data from base. I'm trying to give access to
read to users, who will be in specific domain group. Second new group will
have write permissions. Last will be admins.

How can I pass username from client to SQL by WWW?
 
C

Cowboy \(Gregory A. Beamer\)

There are a couple of ways of accomplishing the scenario envisioned. None of
the scenarios are particularly "easy", however.

Option 1 (not in isolation, i.e. may be PART of the solution) involves
utilizing a common session server for both SharePoint and your web server.
You have to set the same machine keys on both machines to get this to work.
You also have to have identical session cookie names (default is okay, if
you do not wish to monkey). The machines also have to exist in the same
domain in order to read the session cookie.

From the standpoint of the applications, they share authentication, not
session variables. Do not start shoving lots of information into the Session
object and expect to pass between applications (sharepoint and web).

If you set up in this manner and have SQL Server properly configured for the
user(s), you should be fine.

Option 2 involves domain logins. This is strictly for being able to access
the server and may require common session (above), in addition, if you want
to make the appliation work cohesively without data trips from both
machines.

Regardless of which of the above you use (or both), you still need to set up
groups in SQL Server. If you want to maintain the domain aspect (windows
authentication), you should turn off anonymous access on the site, at least
on any interactive pages.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top