Site behind load balancer - Key not valid for use in specified state

Hi,
I have created a sharepoint application page to access an active end point on ADFS and establish a fedauth session. All works well in single server. But when the page runs behind load balancer with 2 servers, it fails with key not valid for use in specified
state exception. Stickiness is enabled on load balancer. verified that.
I had made few changes to config file in microsoft.identitymodel section to accomodate adfs custom login. This included removing securitytokenhandlers and issuertokenresolvers as well. Is this impacting the encryption/decryption in anyway?
Any pointers would help.
Reference point for my application page : http://blog.helloitsliam.com/Lists/Posts/Post.aspx?ID=76

Hi,
As I understand, you encountered the error “Key not valid for use in specified state” when ADFS custom login.
In order to run in Windows Azure Web Sites a Web application which uses WIF for handling authentication, you must change the default cookie protection method (DPAPI, not available on Windows Azure Web Sites) to something that will work in a farmed environment
and with the IIS’ user profile load turned off.
1. If you are using the Identity and Access Tools for VS2012, just go to the Configuration tab and check the box “Enable Web farm ready cookies”.
2. If you want to do things by hand, add the following code snippet in your system.identitymodel/identityConfiguration element:
   <securityTokenHandlers>
     <add type="System.IdentityModel.Services.Tokens.MachineKeySessionSecurityTokenHandler, 
             System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      <remove type="System.IdentityModel.Tokens.SessionSecurityTokenHandler,
            System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    </securityTokenHandlers>
There is a similar case:
http://stackoverflow.com/questions/19323287/key-not-valid-for-use-in-specified-state-error-for-net-4-5-mvc-4-application
Best regards,
Sara Fan
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected]

Similar Messages

  • Reporting Service Integration mode and Key not valid for use in specified state

    I had to uninstall SharePoint Foundation 2013 and reinstall it.
    What I have done:
    I uninstalled SharePoint and after that I removed all databases.
    I reinstalled SharePoint Foundation 2013 and it completed without errors.
    Everything else is working, except SSRS in Sharepoint Integrated Mode.
    If I check Central Administration - Manage services on server, I can found out that SQL Server Reporting Service Service is
    "Started". But if I try to create new service application (SQL Server Reporting Services Service Application), it gives me an error message:
    "Key not valid for use in specified state. (Exception from HRESULT: 0x8009000B)"
    I uninstalled SSRS in Sharepoint Integrated Mode and I reinstalled it but problems exists.
    It seems that "Encryption Keys" cause this problem.
    https://support.microsoft.com/kb/955757
    https://msdn.microsoft.com/en-us/library/ms156010%28v=sql.110%29.aspx
    I tried to Re-create Encryption Keys and Delete keys, but its not working either. It gives me only error message that:
    "Unable to locate the Reporting Server Windows service for instance MSSQLSERVER."
    I don't have any reporting server databases, because I removed all
    databases when I uninstalled SharePoint. Also I don't have Encryption
    Keys backups.
    I have found several similar question but no answer, example here:
    https://social.technet.microsoft.com/Forums/ie/en-US/df02dc05-5ce8-499d-9ba3-ab392a5fc3af/sharepoint-2013-ssrs-application-error-key-not-valid-for-use-in-specified-state-exception?forum=sharepointdevelopment
    Any ideas how I can fix this problem?

    Hi,
    From the Reporting Server Configuration Manager you have to restore the encryption key.
    Please try to delete databases(reportserver & reportservertempdb) and delete the reportserver and reports site on IIS. Then you have to start over the configuration again.
    If the issue still exists, Please check ULS log to see if anything unexpected occurred.
    For SharePoint 2013, by default, ULS log locates in
    "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\LOGS"
    More information about SQL Reporting services Installation with SharePoint 2013 for your reference:
    http://expertsharepoint.blogspot.de/2014/03/sql-reporting-services-installation.html
    Best Regards,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • ERROR: "key not valid for use in specified state" when updating to Lightroom 5.6 in Win8.1

    While doing a routine update from Lightroom 5.5 to v5.6 in Win 8.1, the installation halted at the start of the installation with the vague error message, "key not valid for use in specified state".  Although v5.5 was working just fine, the install routine deleted the v5.5 application files.  I rolled back to the previous system restore point (set just prior to the install) and recovered the executable files.  However, now the 5.5 files won't open the default catalog, none of the backups, or even create a new catalog.
    As v5.x was purchased as an update to v4.x, I've tried to reinstall the original Lightroom v4.x app from the factory disk.  I get the same error.
    Suggestions?
    Thanks. Dan

    I have a similar problem to Dan. while doing a routine upgrade from Lightroom 5.5 to 5.6 I got the
    : "key not valid for use in specified state"
    error and now Lightroom has completely disappeared. I've tried to uninstall, but there is nothing to uninstall. Going back to try to install the original 5.4 just results in the same error.
    A problem may have been that I closed Lightroom when the upgrade started to download. It then re-opened again when the install was halfway through., I assumed that was an error and closed it. just after that the error first appeared in the installer.
    I still had an older version of lightroom 4 installed. I've uninstalled it, and that didn't make any difference.
    I've also tried removing anything in the registry left over from the old installs and that didn't help either.
    Any suggestions?
    CHeers, Angus

  • When I try to install Adobe Acrobat XI Pro, I get an error message, "Key not valid for use in specified state".  What is this?

    When I try to install Adobe Acrobat XI Pro, I get an error message, "Key not valid for use in specified state".  What is this?

    See if this post by turingtest2 fixes it : key not valid for use in specified state

  • Key not valid for use in specified state.

    Hi. Muse update to 2014.1 will not install, so I uninstalled Muse 2014 and tried again and again, no luck. However, I just updated InDesign and Premiere Pro successfully.
    Thank you for any tips.
    Error log is as follows:
    "Payload: Muse CC (2014.1) 2014.1.0.375 Muse_2014_1_CC_LS24.msi_2014.1.0.375 -----------
    ERROR: Key not valid for use in specified state.
    ERROR: Install MSI payload failed with error: 1603 - Fatal error during installation.
    MSI Error message: Key not valid for use in specified state.
    ERROR: Third party payload installer Muse_2014_1_CC_LS24.msi failed with exit code: 1603

    I solved the problem by restarting the computer and logging in to an administrator account. Then I was able to install Muse 2014.1
    Perhaps, if this makes any sense technically, one part of the install process touched a nerve with a component in the process that required admin privileges that my day-to-day account was denying?
    I hope it helps others - and I see there are a few having this problem.
    Again, many thanks for your support, kglad.

  • "key not valid for use in specified state" when installing itunes

    I recently uninstalled an older version of itunes, and every time i try to install the newest version it wont work.
    I just keep getting the message "key not valid for use in specified state". If you know what to do could you
    please make it simple. also do not send me to apple's help section, it does not have ANY answers.
    thanks.

    For "Key not valid for use in specified state" errors try moving the folder RSA from C:\Users\<User>\AppData\Roaming\Microsoft\Crypto\RSA to say C:\RSA (just in case there should be a need to restore it) then try installing again. This folder appears to act as a cache and should be rebuilt automatically as required.
    There is a link to 7-zip in the Install missing components section of the user tip Troubleshooting issues with iTunes for Windows updates, but if you have the key not valid error the advice above should work, and there is no need to break down the setup file.
    tt2

  • Key not valid for use in specified state error message

    I did the update for my iPhone and also tried to update iTunes. I kept getting an error message of "key not valid for use in specified state" error message. I thought that if I uninstalled iTunes and re-installed it, that it would be fine. I'm still getting the message and now I don't have iTunes. When my phone updated, I couldn't download anything/backup my phone to iTunes. Please help. Thank you in advance.

    For "Key not valid for use in specified state" errors try moving the folder RSA from C:\Users\<User>\AppData\Roaming\Microsoft\Crypto\RSA to say C:\RSA (just in case there should be a need to restore it) then try installing again. This folder appears to act as a cache and should be rebuilt automatically as required.
    For further problems installing iTunes see Troubleshooting issues with iTunes for Windows updates.
    tt2

  • Key not valid for use in specified state when running install_reader11_en_mssd_aaa_aih

    After downloading, Version XI (11.0.08)
    at
    http://get.adobe.com/reader/download/?installer=Reader_11.0.08_English_for_Windows&os=Wind ows%207&browser_type=KHTML&browser_dist=Chrome&d=McAfee_Security_Scan_Plus_Chrome_Browser& dualoffer=false
    running, and installing _reader11_en_mssd_aaa_aih
    I get "
    adobe reader installer error
    key not valid for use in specified state
    Using Windows 7, tried google chrome and firefox browsers
    system report created but could not send

    This worked:
    Solution 2: Re-create the Crypto folder.
    Close Acrobat. 
    In Windows Explorer, do one of the following:
    On Windows XP, navigate to C:\Documents and Settings\[your user name]\Application Data\Microsoft.
    On Windows Vista, navigate to C:\Users\[your user name]\AppData\Roaming\Microsoft.
    Note: These paths include hidden folders. To make hidden folders visible, see "Windows Tip - Show hidden files and folders" (TechNote kb402324).
    Rename the Crypto folder as Crypto Old. 
    Open Acrobat. The Crypto folder will be re-created automatically. 
    Error: "Creation of this signature could not be completed. Platform Exception" when you sign a PDF (Acrobat 8, 9 on Wind…
    Then deleted wse_andromenda files in control panel programs, run regedit

  • Key not valid for use in specified state - installation error

    I am trying to install Adobe Reader XI on a Windows 7 computer at work and I get this error message:  "key not valid for use in specified state."  What is going on and how do I fix the problem so that i can install Adobe Reader?

    This worked:
    Solution 2: Re-create the Crypto folder.
    Close Acrobat. 
    In Windows Explorer, do one of the following:
    On Windows XP, navigate to C:\Documents and Settings\[your user name]\Application Data\Microsoft.
    On Windows Vista, navigate to C:\Users\[your user name]\AppData\Roaming\Microsoft.
    Note: These paths include hidden folders. To make hidden folders visible, see "Windows Tip - Show hidden files and folders" (TechNote kb402324). 
    Rename the Crypto folder as Crypto Old. 
    Open Acrobat. The Crypto folder will be re-created automatically. 
    Error: "Creation of this signature could not be completed. Platform Exception" when you sign a PDF (Acrobat 8, 9 on Wind…
    Then deleted wse_andromenda files in control panel programs, run regedit

  • "Key not valid for use in specified state" after IIS Reset?

    I have had a ton of issues with the System.Security.Cryptography.CryptographicException: Key not valid for use in
    specified state. error. This seems to only occur now when IIS is reset and I try to resume my browsing session. So I am logged into the application, I reset IIS on the server, refresh the page and see the error.
    I am building an application in .NET 4.0 MVC with a Secure Token Service that is using WIF 4.0. Everything works as expected, except this case. I even tried to use a custom error page, but the error is happening there as well. Because of that, I can't get the
    custom page to show either. One thing I noticed is that if I switch my IIS APP Pool user back to Network Service account it doesn't throw the error any more. We have some restrictions (mostly network related) in the application that we need to use an account
    in our AD for the app pool sections
    Anybody have any experience with this issue?

    Hi Shennessy,
    In my opinion, this thread is related to ASP.NET forum. So please post thread on that forum for more effective response. Thank you for understanding. Please refer to the following link.
    http://forums.asp.net/.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Reinstalling,APSE11,from,original,CD,with,serial,number,,I,get,the,message,"Key,not,valid, for,use,in,specified,state."

    While reinstalling APSE 11 (windows) from original CD (with serial number), I get the message "Key not valid for use in specified state."  What do I do?

    Unfortunately, you're in the wrong forum.  This is not the Elements forum.
    Here's the link to the forum you want:
    https://forums.adobe.com/community/photoshop_elements/content

  • Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state

    we have developed packages to do the followings
    Extract data from DB2 Source and put it in MS Sql Server 2008 database (Lets Say DatabaseA).From MS Sql Server 2008 (DatabaseA)
    we will process the data and place it in another database MS Sql Server 2008 (DatabaseB)
    We have created packages in BIDS..We created datasource connection in Datasource folder in BIDS..Which has DB2 Connection and both Ms Sql Server connection (Windows authentication-Let
    say its pointing to the server -ServerA which has DatabaseA and DatabaseB).The datasource connections will be used in packages during development.
    For deployment we have created Package Configuration which will have both DB2 Connection and MS SqlServer connection in the config
    We deployed the packages in different MS SqlServer by changing the connectionstring in the config for DB2 and MS SqlServer...
    While runing the package we are getting the following error message
    Code: 0xC0016016     Source:       Description: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for
    use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.
    ilikemicrosoft

    Hi Surendiran,
    This is because the package has been created by somebody else and the package is being deployed under sombody else's account. e.g. If you are the creator then the package is encryption set according to your account and the package setup in SQL server is
    under a different user account.
    This happens because the package protection level is set to EncryptSensitiveWithUserKey which encrypts
    sensitive information using creator's account name.
    As a solution:
    Either you have to set up the package in SQL server under your account (which some infrastructures do not allow).
    OR
    Set the package property Protection Level to "DontSaveSensitive" and add a configuration file
    to the package and set the initial values for all the variables and all the connection manager in that configuration file (which might be tedious of-course).
    OR
    The third options (which I like do) is to open the package file and delete the password encryption entries from the package. Do note that this is not supported by designer and every time you make changes to the connection managers these encryption entries come
    back.
    Hope this helps. 
    Please mark the post as answered if it answers your question

  • SQL Server Mgt Studio 2008 installation problem - Key not valid for use in specified state

    I'm setting up SQL Server Management Studio 2008 on my laptop.  It installed fine, but failed to import a regsrver file exported from another machine. This appears to have been due to the fact that I exported the file with usernames and passwords, although I must admit that's pretty darned inconvenient if it can't be done. 
    Nevertheless, I exported the file again without usernames and passwords, but the new install now won't let me even see servers, let alone import any new ones.
    When I start Studio, it gives me the "Key not valid for use in specified state" error.  When I 'continue', I'm delivered to a screen with the 'registered servers' pane crippled.  It has no contents at all and no ability to add, select, import, export.  Nothing there.
    How do I rectify this?
    The installation is on Windows 7 Home Premium.
    Thanks for any suggestions.

    Hi Don,
    Since this issue was still not resolved even after you reinstall SQL Server 2008, I think that this issue is probably related to some corrupted files or registry keys. Please refer to the following steps to see if you can resolve this issue:
    1. Close your SSMS;
    2. Go to the folder %appdata%\Microsoft\Microsoft SQL Server\100\Tools\ and check if there is a Shell folder, if so, rename it to Shell-Copy;
    3. Re-open your SSMS to see if the error persists.
    Everytime SQL Server 2008 Management Studio starts, it will read information from this folder to retrieve and recover some data. If the information does not exists, it will recreate new ones. Please check if this helps.
    Best regards,
    Charles Wang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    To add to Don's comment, if you are using a different account (for example, an SA account) to run SQL Server management studio then make sure to change the user profile name when you browse to "%appdata%\Microsoft\Microsoft SQL Server\100\Tools\".
    I know many of us developers have multiple accounts and I usually have my SA account have logon privileges on databases not my regular AD Account.
    Other than that, the reason why this fails is because MS encrypted the regsrvr file on the source computer using the source computer's ID and is therefore unable to decrypt the file on the destination computer. To me that just doesn't make sense since the
    whole idea of Export and import was to move this information across computers! And that's why this works when you import without username and passwords - no more encryption/decryption. Since we use integrated windows logon (trusted_connection=true) it works
    great. For the few servers that we had SQL Logons I had to manually type them in and save. But all in all, pretty painless.

  • Why do I keep getting the message "key not valid for use in specified state"?

    why do I keep getting the message "key not valid for use in specified state"?

    You need to deal with Adobe Customer support.  This is a  Photoshop User forum the is also one for LR may be some on over there has encountered you problem Photoshop Lightroom

  • I get this error when downloading key not valid for use in specified state what do i do

    i get this error when downloading key not valid for use in specified state what do i do

    What is your operating system?  What are you trying to download?

Maybe you are looking for

  • New folder in iphoto

    I created a new folder in iphoto to transfer some photos from the iphoto library. 1. after transferring to the new folder why is the photo still in the library? 2. why is it that when i delete the photo in the library, the same photo in the new folde

  • Oop project management

    Hello, i have create an oop project for an application. Now i would like to reuse all classes for distinct project  keeping links with this pack of classes may be this is what is called framework  i would like that modifiying a classe impact both pro

  • Using "v" function in row-level triggers

    I have row-level triggers that do l_user := nvl(v('APP_USER'),user); to get the user that is running the app and record that in the table or wherever. Since it is a row-level trigger, the "v" function will be called for each and every row even though

  • MaxDB / SQL studio - command question..

    Hello, I have MaxDB7.6 installed in my system(winxP prof) during NW2004s ABAP installation. I tried to connect in command line using 'superdba' and 'control', it connects. dbmcli - d NSP -u superdba,admin dbmcli - d NSP -u control,admin At the same t

  • Charging is not supported with this accessory iPhone 5 and lighting adapter

    I just received my 30 pin lighting adapter for my iPhone 5 and connected it to my existing BMW (2008 335i) factory 30 pin cable. The battery changes to the charge symbol for a few seconds and then I get a error on my phone that says "charging is not