Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am using FBA with SqlMembership Provider in sharepoint 2010 and its not working if i set passwordFormat="Encrypted" in all web.configs(web,central,STS) and here is error from ULS Password check on 'cratledge' generated exception: 'System.Configuration.Provider.ProviderException: You must specify a non-autogenerated machine key to store passwords in the encrypted format. Either specify a different passwordFormat, or change the machineKey configuration to use a non-autogenerated decryption key.
at System.Web.Security.MembershipProvider.EncryptPassword(Byte[] password)
at System.Web.Security.MembershipProvider.EncodePassword(String pass, Int32 passwordFormat, String salt)
at System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat)
at System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password)
at Microsoft.SharePoint.IdentityModel.SPFormsUserNameSecurityTokenHandler.ValidateToken(SecurityToken token)'.

Now if i change PasswordFormat from 2(Encrypted) to 0(Clear) then its working.

please advise on this issue

Thanks ROnak

share|improve this question

1 Answer 1

up vote 1 down vote accepted

The issue is what the error states: You need to specify the key that is used to encrypt/decrypt the password in machineKey section of the web.config. There is more information here:

http://technology.bauzas.com/programming/net/you-must-specify-a-non-autogenerated-machine-key-to-store-passwords-in-the-encrypted-format-either-specify-a-different-passwordformat-or-change-the-machinekey-configuration-to-use-a-non-autogenera/

Don't forget to make these changes to all web.config files (STS, Central Admin + Web Applications)

I would recommend using the value "Hashed" instead, which does not need this key and is actually more secure than "Encrypted" - as Encrypted passwords can be decrypted while Hashed passwords cannot.

share|improve this answer
    
Thanks Chris.just solved the issue and did same thing you mention in your comment. –  Ronak Jan 16 '13 at 15:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.