Problem importing membership users
Posted: Fri 12 Apr 2013 18:45
We have a web app working fine in a production server. We have developed a new version of such web app and we are trying to bring the users from the old app to the new app. For this purpose, we did the following:
1) We exported the required membership tables from the old web app (aspnet_users, aspnet_membership, aspnet_roles and aspnet_usersinroles)to text files delimited by TABS.
2) We imported the text files generated in step (1) to the new web app tables.
3) We used a tool called PostgreSQL Maestro to achieve steps (1) and (2).
4) The aspnet_membership table in the new web app has 2 fields that are not present in the old web app table: "passwordsalt" and "passwordformat".
5) We replaced the "passwordformat" field value with 2 which indicates ENCRYPTED, we do not use TEXT or HASH format.
6) We left the value of the "passwordsalt" field equal to NULL.
7) The old web app uses the following tool versions: DevArt v5.50.228.0 and .Net Framework 3.5.
8) The new web app uses the following tool versions: DevArt v6.0.6.0 and .Net Framework 4.0.
9) The parameters of "machineKey" entry in web.config of the new web app are exactly the same as in the old web app.
10) The provider parameters in the old web app have a difference with those in the new web; the new app includes applicationName="/" whereas the old one does not.
Old web app:
<add name="AspNetPgSqlMembershipProvider" type="Devart.Data.PostgreSql.Web.Providers.PgSqlMembershipProvider" description="dotConnect for PostreSQL membership provider" connectionStringName="restaurantConnString" passwordFormat="Encrypted" enablePasswordRetrieval="true" minRequiredPasswordLength="7" requiresQuestionAndAnswer="true" requiresUniqueEmail="false" maxInvalidPasswordAttempts="99" passwordAttemptWindow="5" minRequiredNonalphanumericCharacters="0" />
New web app:
<add name="AspNetPgSqlMembershipProvider" type="Usuarios" description="dotConnect for PostreSQL membership provider" connectionStringName="eUsuarioConnString" passwordFormat="Encrypted" enablePasswordRetrieval="true" minRequiredPasswordLength="7" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="99" passwordAttemptWindow="5" minRequiredNonalphanumericCharacters="0" applicationName="/" />
We will very much appreciate any comment about this issue. Below we include the error message text for your reference when trying to validate user credentials:
Provider can not decode password
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Configuration.Provider.ProviderException: Provider can not decode password
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ProviderException: Provider can not decode password]
Devart.Common.Web.Providers.DbMembershipProvider.a(String A_0, MembershipPasswordFormat A_1) +172
Devart.Common.Web.Providers.DbMembershipProvider.a(String A_0, String A_1, MembershipPasswordFormat& A_2, String& A_3) +226
Devart.Common.Web.Providers.DbMembershipProvider.ValidateUser(String username, String password) +49
System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +60
System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +129
System.Web.UI.WebControls.Login.AttemptLogin() +127
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +101
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +125
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +167
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
1) We exported the required membership tables from the old web app (aspnet_users, aspnet_membership, aspnet_roles and aspnet_usersinroles)to text files delimited by TABS.
2) We imported the text files generated in step (1) to the new web app tables.
3) We used a tool called PostgreSQL Maestro to achieve steps (1) and (2).
4) The aspnet_membership table in the new web app has 2 fields that are not present in the old web app table: "passwordsalt" and "passwordformat".
5) We replaced the "passwordformat" field value with 2 which indicates ENCRYPTED, we do not use TEXT or HASH format.
6) We left the value of the "passwordsalt" field equal to NULL.
7) The old web app uses the following tool versions: DevArt v5.50.228.0 and .Net Framework 3.5.
8) The new web app uses the following tool versions: DevArt v6.0.6.0 and .Net Framework 4.0.
9) The parameters of "machineKey" entry in web.config of the new web app are exactly the same as in the old web app.
10) The provider parameters in the old web app have a difference with those in the new web; the new app includes applicationName="/" whereas the old one does not.
Old web app:
<add name="AspNetPgSqlMembershipProvider" type="Devart.Data.PostgreSql.Web.Providers.PgSqlMembershipProvider" description="dotConnect for PostreSQL membership provider" connectionStringName="restaurantConnString" passwordFormat="Encrypted" enablePasswordRetrieval="true" minRequiredPasswordLength="7" requiresQuestionAndAnswer="true" requiresUniqueEmail="false" maxInvalidPasswordAttempts="99" passwordAttemptWindow="5" minRequiredNonalphanumericCharacters="0" />
New web app:
<add name="AspNetPgSqlMembershipProvider" type="Usuarios" description="dotConnect for PostreSQL membership provider" connectionStringName="eUsuarioConnString" passwordFormat="Encrypted" enablePasswordRetrieval="true" minRequiredPasswordLength="7" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="99" passwordAttemptWindow="5" minRequiredNonalphanumericCharacters="0" applicationName="/" />
We will very much appreciate any comment about this issue. Below we include the error message text for your reference when trying to validate user credentials:
Provider can not decode password
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Configuration.Provider.ProviderException: Provider can not decode password
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ProviderException: Provider can not decode password]
Devart.Common.Web.Providers.DbMembershipProvider.a(String A_0, MembershipPasswordFormat A_1) +172
Devart.Common.Web.Providers.DbMembershipProvider.a(String A_0, String A_1, MembershipPasswordFormat& A_2, String& A_3) +226
Devart.Common.Web.Providers.DbMembershipProvider.ValidateUser(String username, String password) +49
System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +60
System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +129
System.Web.UI.WebControls.Login.AttemptLogin() +127
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +101
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +125
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +167
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563