CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.security Tags:
Item Type: NewsGroup Date Entered: 10/5/2007 6:16:45 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 42 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
janid1967
Asp.Net User
Forms authentication and membership data in remote database10/5/2007 6:16:45 AM

0/0

Hello all

I've developing a simple ASP.NET 2.0 appl using Forms authentication with membership and roleprovider data in a remote SQL database.

My setup:

PC1: Developing PC, XP Home edition, with VS 2005,  

PC2: Deploy PC, XP Pro edition, IIS 5.1, SQL Server Express. Anonymous logon is turned OFF in IIS

I've read many good blogs about the topic (Scott Guthrie: http://weblogs.asp.net/scottgu/archive/2006/02/24/ASP.NET-2.0-Membership_2C00_-Roles_2C00_-Forms-Authentication_2C00_-and-Security-Resources-.aspx and Scott Mitchell).

I've followed guides to setup membership database in SQL Express db at PC2 using aspnet_regsql.exe. (However: Scott Guthries guide is telling how to setup remote membership db in 2000 or 2005 SQL server. I've used SQL Express 2005) When developing at PC1, I can use ASP.NET Web Site Administration Tool to setup Users and Roles in this membership database. (Data enteres can be confirmed by browsing DB). My web.config file contains these lines to "point" to the remote database instead of default SQL Express database:

<connectionStrings>

<!-- Remove LocalSqlServer to remove the default connection to SQL Express ... then add to the remote intance

Ref: http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx  -->

<remove name="LocalSqlServer"/>

<add name="LocalSqlServer"

connectionString="Data Source=DIMENSION4550;Initial Catalog=usersandroles;Integrated Security=True"

providerName="System.Data.SqlClient" />

</connectionStrings>

<system.web>

<identity impersonate="true"/>

<membership defaultProvider="CustomizedMembershipProvider">

<providers>

<add name="CustomizedMembershipProvider"

type="System.Web.Security.SqlMembershipProvider"

connectionStringName="LocalSqlServer"

applicationName="/mpa"

requiresUniqueEmail="false"

minRequiredPasswordLength="5"

minRequiredNonalphanumericCharacters="0" />

</providers>

</membership>

<roleManager enabled="true" defaultProvider="CustomizedRoleProvider">

<providers>

<add name="CustomizedRoleProvider"

type="System.Web.Security.SqlRoleProvider"

applicationName="/mpa"

connectionStringName="LocalSqlServer" />

</providers>

</roleManager>

.....

When running solution in debug mode at PC1, all works as intended. I'm using VS -> Build -> Publish to deploy the solution to PC2. When accessing solution at PC2 (from localhost at PC2 or through internet), When accessing pages, I first logon to IIS (no anonymous access) using an account on PC2. Further I can open my solution, the part which don't need authentication.

The problem:

I can't get the solution to log on to my usersandroles database. Exception is thrown once my code is accessing membership parts (i.e: login): [SqlException (0x80131904): Login failed for user 'DIMENSION4550\ASPNET'.] I think I've tried most combinations in connectionstring and identety impersonate to logon, but no success (User ID / Password in clear text)

Ideas? Where do I fail?

Jan

RichardD
Asp.Net User
Re: Forms authentication and membership data in remote database10/5/2007 7:11:23 PM

0/0

The Windows account "DIMENSION4550\ASPNET" has not been granted access to SQL. You need to add it as a login, and grant it access to the "usersandroles" database.

janid1967
Asp.Net User
Re: Forms authentication and membership data in remote database10/6/2007 11:12:45 AM

0/0

You where right. Instead of using Win account, I did this:

  1. opened for SQL account authentication in SQL
  2. created an new SQL account
  3. gave this SQL account least previlegies (CONNECT, SELECT and EXECUTE) in the appropreiate database
  4. Used User ID + password in my connection string in the .NET solution

Voala .. worked as it should, both from development pc and after deploying. Must encrypt my connection string in web.config, but that is another story.

Thx

Rgds Jan Inge

3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Expert ASP.NET 2.0 Advanced Application Design: Advanced Application Design Authors: Dominic Selly, Andrew Troelsen, Tom Barnaby, Pages: 459, Published: 2005
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005
Pro ASP.NET 2.0 in VB 2005: special edition. Authors: Laurence Moroney, Matthew MacDonald, Pages: 1360, Published: 2006
Pro ASP.NET 2.0 in C# 2005: Create Next-generation Web Applications with the Latest Version of Microsoft's Revolutionary Technology Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1426, Published: 2006
Pro ASP.NET for SQL Server: High Performance Data Access for Web Developers Authors: Brennan Stehling, Pages: 408, Published: 2007
Professional ASP.NET 2.0 Security, Membership, and Role Management Authors: Stefan Schackow, Pages: 611, Published: 2006
Organizational Data Mining: Leveraging Enterprise Data Resources for Optimal Performance Authors: Hamid R. Nemati, Christopher D. Barko, Pages: 371, Published: 2003
Hardening Windows Systems: [bulletproof Your Systems Before You are Hacked!] Authors: Roberta Bragg, Pages: 526, Published: 2004
ACCCN's Critical Care Nursing Authors: Doug Elliott, Leanne Aitken, Wendy Chaboyer, Pages: 1000, Published: 2006

Web:
How To: Use Forms Authentication with SQL Server in ASP.NET 2.0 The membership feature provides an abstraction for the underlying data store used to .... Connecting to a Remote Database Without Windows Authentication ...
ASP.NET 2.0 Membership, Roles, Forms Authentication, and Security ... Mar 25, 2008 ... NET 2.0 Membership, Roles and Forms Authentication Video ... and uses a SQL Express database to store Membership, Roles and Profile data. ...
ASP.NET 2.0 Membership, Roles, Forms Authentication, and Security ... It walks through how to add Forms Authentication (using the ...... How will I connect my membership and Roles data with the Oracle database. ...
ASP.NET 2.0 Membership, Roles, Forms Authentication, and... review ... NET Membership, Roles and Personalization * Access Database Support for ASP. ... ASP.NET forms authentication with roles. First picked by senfo ...
CodeProject: .NET Role-Based Security in a Production Environment ... May 19, 2008 ... In a production environment, a remote database is used and not a local .... How To: Use Forms Authentication with Active Directory in ASP. ...
Configuring Forms Authentication in SharePoint 2007 Either the membership database is hosted on a local or on a remote SQL instance, the permission ..... Subject: Form Authentication Using Oracle Data Store ...
Configure SQL Membership Provider forms authentication for Project ... All forms-authenticated accounts using the SQL Membership Provider to access Office Project Server 2007 ... Creates the database on a remote SQL Server. ...
FormsAuthentication.Authenticate will not return TRUE using ... Yep, you can't use FormsAuthentication.Authenticate with a aspnetsqlprovider... instead you must use membership.ValidateUser as follows: If Membership. ...
CodeProject: .NET Role-Based Security in a Production Environment ... May 19, 2008 ... In a production environment, a remote database is used and not a local user instance of .... Role-based Security with Forms Authentication. ...
patterns & practices: WCF Security Guidance - Home This server in turn connects to a remote database server. ... SqlMembershipProvider is configured to use with Membership feature for forms authentication ...




Search This Site:










execute javascript on submit

yetanotherforum.net error

a label that show's something like.."portal configurations where last saved: 24/11/07"

loss of intelisence in web.config

re: http://vision.bhattji.com and ndeploy?

varible declaration

windows authentication problem

web control resources

unable to sign on as admin user from any computer other than webserver

blogging solutions for asp.net

dynamic menu

how to insert seperator in solpart menu?

using profile in asp,net 2.0

trying to use web.config for connection strings

a baniere which contains a research?

program for accessing mssql database on webhost?

visual studio 2005

opening sln files in vs.net

use webservice in aspx?

how to search a hash table for a value that corresponds to a given key

help201 - question making call to framework 2

beta 2

how can i copy sourcecode from remote website?

cannot add admin user

vs2008 asp.net configuration menu option missing

how to create a control in behind-code?

3.0.10 issue: deleting non-loading modules from a page.

external form, submitted or not!

famous could not copy files to runtime directory error

could not access 'cdo.message' object. (proper smtp settings!!!)

 
All Times Are GMT