Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Environment: OnPrem

Admin App Version: >= 2.2.0

Note: Admin App version 2.2+, the encryption and decryption operation are using AES algorithm. So, it is very uncommon to encounter the key and secret cannot be used in that state issue.

Uncommon cases:

  1. User missed to maintain/ retain the EncryptionKey while upgrading the application from version 2.2+ to latest version (Please find the documentation on upgrading Admin App here)
  2. Missing the encryption key on the appsettings.json after the first-time setup completed on Admin App 2.2+

Note: Please make sure to create new EncryptionKey using the following PowerShell command and update the appsettings.json with newly created value before running the first-time setup again on Admin App.

Code Block
languagepowershell
titleGenerate Encryption Key
collapsetrue
$aes = [System.Security.Cryptography.Aes]::Create()
$aes.KeySize = 256
$aes.GenerateKey()
$EncryptionKey = [System.Convert]::ToBase64String($aes.Key)

If user is in any of the above-mentioned situation, please follow the following steps to recover the application and force the first-time setup on Admin App.

Steps for Recovering the Application on Shared Instance mode

1) Clear Configuration Parameters & Force Admin App's First-Time Setup

  1. Please make sure to stop ODS API and Admin App websites under IIS.
  2. Connect to SQL Server on SSMS.

  3. Select the EdFi_Admin database.

  4. Execute the following sql commands for clearing all the data records created during first time setup process.

    Code Block
    languagesql
    titleVoid first time setup updates
    collapsetrue
    BEGIN TRAN   
    DECLARE @ApplicationId INT;
     
    SELECT @ApplicationId = ApplicationId FROM dbo.Applications WHERE ClaimSetName = 'Ed-Fi ODS Admin App'
     
    DELETE FROM dbo.ClientAccessTokens WHERE EXISTS (
            SELECT 1 FROM dbo.ApiClients
            WHERE ClientAccessTokens.ApiClient_ApiClientId = ApiClients.ApiClientId
            AND Application_ApplicationId = @ApplicationId
    )
        DELETE FROM dbo.ApiClients WHERE Application_ApplicationId = @ApplicationId
        DELETE FROM dbo.ApplicationEducationOrganizations WHERE Application_ApplicationId = @ApplicationId
        DELETE FROM dbo.ProfileApplications WHERE Application_ApplicationId = @ApplicationId
        DELETE FROM dbo.Applications WHERE ApplicationId = @ApplicationId    
        DELETE FROM adminapp.SecretConfigurations
    	DELETE FROM [EdFi_Admin].[adminapp].[OdsInstanceRegistrations]
    	UPDATE dbo.Applications set OdsInstance_OdsInstanceId = null  -- making sure to remove the foreign key constrain 
    	UPDATE [EdFi_Admin].[adminapp].[ApplicationConfigurations] SET FirstTimeSetUpCompleted = 0 
    	DELETE FROM dbo.OdsInstances
    COMMIT  TRAN


  5. Once successfully executing the above mentioned SQL script, please restart the Admin App website under IIS

  6. Now browsing the Admin App will take user to first time setup page

Environment: Azure

Admin App Version: < 2.2.0

Issues

The application deployed and First-Time setup was successful, however you are unable to proceed further with the Admin App settings page or you get an error message saying that the key and secret can not be used in that state.

...

Steps for Recovering the Application

1) Clear Configuration Parameters & Force Admin App's First-Time Setup

On this step, we need to clear all the data records created during first time setup.

...