473,382 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

SqlMembershipProvider database reusage

Is it possible to reuse existing SQLSERVER database containing
membership information for different application? Basically this is a
situation.

1. Created application App1 where with a help of standard Login
control membership user has been created.
2. Created application App2 which pointed to the existing database.
Login fails in standard Login contriol. On attempt to get user
password with Membership.GetPassword an exception about invalid
padding occurs. But the user itself is visible. So the problem is in
password encoding/decoding.
3. Login is successful only if App1 and App2 have the same name, i.e
App2 rename to App1. Is web application name somehow used in the
password encoding?

Both applications have identical "connectionStrings" "machineKey" and
"membership" settings.

<machineKey

validationKey="d39e99d66aed2c499a1df4e14a87c9f1e1d 33053872cfe59aeeb45292062277ca4b340956bb9f4c2a1f5e eb32424b544301de184ede8bd9092de10598d8c5d31,Isolat eApps"

decryptionKey="bce3637636b67a5c7e6832e71a406bdff3d c92c218268168,IsolateApps"
validation="3DES"
decryption="AES"/>
<membership userIsOnlineTimeWindow="60">
<providers>
<remove name="AspNetSqlMembershipProvider"/>
<add
connectionStringName="LocalSqlServer"
enablePasswordRetrieval="true"
enablePasswordReset="false"
requiresQuestionAndAnswer="false"
applicationName="/"
requiresUniqueEmail="false"
passwordFormat="Encrypted"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""
name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</membership>
<authentication mode="Forms">
<!-- Detailed configuration options -->
<forms name="FAWSCCookie" loginUrl="~/login.aspx" timeout="60"
slidingExpiration="true" cookieless="AutoDetect" protection="All"
requireSSL="false" enableCrossAppRedirects="false"
defaultUrl="home.aspx" path="/"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>

Thank you for any help.
Nov 21 '07 #1
1 2658
If you want to share the information in the database across apps, then all
have the same name, as far as membership goes. If, instead, you desire to
use a single membership database across many apps, without sharing, you can
use different app names.

The other option is a custom membership provider.
http://www.devx.com/asp/Article/29256

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
<gl*******@gmail.comwrote in message
news:fd**********************************@y43g2000 hsy.googlegroups.com...
Is it possible to reuse existing SQLSERVER database containing
membership information for different application? Basically this is a
situation.

1. Created application App1 where with a help of standard Login
control membership user has been created.
2. Created application App2 which pointed to the existing database.
Login fails in standard Login contriol. On attempt to get user
password with Membership.GetPassword an exception about invalid
padding occurs. But the user itself is visible. So the problem is in
password encoding/decoding.
3. Login is successful only if App1 and App2 have the same name, i.e
App2 rename to App1. Is web application name somehow used in the
password encoding?

Both applications have identical "connectionStrings" "machineKey" and
"membership" settings.

<machineKey

validationKey="d39e99d66aed2c499a1df4e14a87c9f1e1d 33053872cfe59aeeb45292062277ca4b340956bb9f4c2a1f5e eb32424b544301de184ede8bd9092de10598d8c5d31,Isolat eApps"

decryptionKey="bce3637636b67a5c7e6832e71a406bdff3d c92c218268168,IsolateApps"
validation="3DES"
decryption="AES"/>
<membership userIsOnlineTimeWindow="60">
<providers>
<remove name="AspNetSqlMembershipProvider"/>
<add
connectionStringName="LocalSqlServer"
enablePasswordRetrieval="true"
enablePasswordReset="false"
requiresQuestionAndAnswer="false"
applicationName="/"
requiresUniqueEmail="false"
passwordFormat="Encrypted"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""
name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</membership>
<authentication mode="Forms">
<!-- Detailed configuration options -->
<forms name="FAWSCCookie" loginUrl="~/login.aspx" timeout="60"
slidingExpiration="true" cookieless="AutoDetect" protection="All"
requireSSL="false" enableCrossAppRedirects="false"
defaultUrl="home.aspx" path="/"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>

Thank you for any help.

Nov 21 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ibiza | last post by:
Hi, what would be the simplest way to add a functionality so it is possible to change the username in an asp.net 2.0 webapplication that uses SqlMembershipProvider? By default, this providers...
3
by: anon2005 | last post by:
I'm writing an installed for my application that uses a SqlMembershipProvider. I'd like to have the installer automatically set up the required roles and users for the application, but I can't...
0
by: Ron | last post by:
Hi, I want to create a new SqlMembershipProvider called SqlMembershipProviderEx I will use it to create two User objects which only need a UserName and Password. ServiceProviders and...
2
by: daz_oldham | last post by:
Hi All Bit of an odd one - very basically I created an app using the SqlMembershipProvider in VS.NET 2005, and I did it on a MS SQL 2005 server. However, I then find out that for other...
0
by: Mwob | last post by:
Hi all, I'm about to start creating a custom membership provider. Its for a website that already has a table of users in a single table, so I need to create a custom MP to talk to the data in...
3
by: Ryan | last post by:
Hello, I have a question on the default: AspNetSqlProvider. I know that, by default, this looks for a database created locally in the appdata directory. Although I have learned how to change...
0
by: mazdotnet | last post by:
Hi, I just started using the new asp.net sqlMembershipProvider (users and roles) which works great. However, I'm testing my application on Windows XP and I'm getting different list of roles...
1
by: Matt MacDonald | last post by:
Hi all, I've been debating for a while (basically since asp.net 2.0 came out) on using the built in mebership classes to handle user management in my web apps. I seem to keep coming upon...
3
by: Jeff | last post by:
hi asp.net 2.0 sql server 2005 I've created a database on my win2k3 machine. Now I'm moving this database over to my Vista business 32bit machine. (I scripted the database on the win2k3...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.