Same problem reported 7 times in this forum

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
2/9/2011 5:08:28 AM
Gravatar
Total Posts 37

Same problem reported 7 times in this forum

I am suddenly having a problem with an error stopping at this code in MojoPortal.Web.MojoMembershipProvider at the following code:

byte[] bRet = DecryptPassword(bIn);

in this method:

UnencodePassword(string pass, MembershipPasswordFormat passwordFormat)
        {
            switch (passwordFormat)
            {
                case MembershipPasswordFormat.Clear:
                    return pass;
                case MembershipPasswordFormat.Hashed:
                    throw new ProviderException("Can't decrypt hashed password");
                default:
                    byte[] bIn = Convert.FromBase64String(pass);
                    byte[] bRet = DecryptPassword(bIn);
                   
                    if (bRet == null)
                        return null;

                    return Encoding.Unicode.GetString(bRet);
            }
        }

 

The error:

ERROR mojoPortal.Web.Global - 127.0.0.1-en-US - /Admin/SiteSettings.aspx
System.Web.HttpException (0x80004005): Unable to validate data.
   at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean useValidationSymAlgo, Boolean useLegacyMode, IVType ivType, Boolean signData)
   at System.Web.Security.MembershipAdapter.EncryptOrDecryptData(Boolean encrypt, Byte[] buffer, Boolean useLegacyMode)
   at System.Web.Security.MembershipProvider.DecryptPassword(Byte[] encodedPassword)
   at mojoPortal.Web.mojoMembershipProvider.UnencodePassword(String pass, MembershipPasswordFormat passwordFormat) in                      ~\mojoportal\Web\Components\mojoMembershipProvider.cs:line 1429
   at mojoPortal.Web.SiteUtils.Decrypt(String encrypted) in ~\mojoportal\Web\Components\SiteUtils.cs:line 2148
   at mojoPortal.Web.AdminUI.SiteSettingsPage.PopulateMailSettings() in ~\mojoportal\Web\Admin\SiteSettings.aspx.cs:line 968
   at mojoPortal.Web.AdminUI.SiteSettingsPage.PopulateControls() in ~\mojoportal\Web\Admin\SiteSettings.aspx.cs:line 541
   at mojoPortal.Web.AdminUI.SiteSettingsPage.Page_Load(Object sender, EventArgs e) in ~\mojoportal\Web\Admin\SiteSettings.aspx.cs:line 96
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at mojoPortal.Web.mojoBasePage.OnLoad(EventArgs e) in ~\mojoportal\Web\Components\mojoBasePage.cs:line 695
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

 

 

I found 7 items in this forum with the same problem ut none of the solutions worked for me. I even recreated a new project from Mercurial in case there was a problem I couldn't find. Got rid of all cookies and history. The only thing I haven't done is to download a new database and start all over. Hope I don't have to take that route. Please help. Everything was going smooth for a long time and now this.

2/9/2011 7:14:51 AM
Gravatar
Total Posts 18439

Re: Same problem reported 7 times in this forum

This will happen if you use encrypted passwords and then the machine key is changed, it can no longer decrypt the data. Once you set a custom machine key you must make sure to always keep that machine key and restore it to Web.config after upgrading.

http://www.mojoportal.com/use-a-custom-machine-key.aspx

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.