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:
- User missed to maintain/ retain the EncryptionKey while upgrading the application from version 2.2+ to latest version (Please find refer the documentation on upgrading Admin App here)
- Missing the encryption key on the appsettings.json after the first-time setup completed on Admin App 2.2+
...
- Please make sure to stop ODS API and Admin App websites under IIS.
Connect to SQL Server on SSMS.
Select the EdFi_Admin database.
Execute the following sql commands for clearing all the data records created during first time setup process.
Code Block language sql title Void first time setup updates collapse true 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
Once successfully executing executed the above mentioned SQL script, please restart the Admin App website under IIS
- Now browsing the Admin App will take user to the first time setup page
For recovering already created vendor applications on Admin App, user needs to manually update OdsInstance_OdsInstanceId column on dbo.Applications table to have default Ods instance id. On SharedInstance mode will be having only one OdsInstance on dbo.OdsInstances table.
Code Block language sql title Update Applications collapse true DECLARE @odsinstanceid INT SELECT TOP 1 @odsinstanceid = OdsInstanceId FROM [dbo].[OdsInstances] Update [EdFi_Admin].[dbo].[Applications] set OdsInstance_OdsInstanceId = @odsinstanceid where OdsInstance_OdsInstanceId is null
Environment: Azure
Admin App Version: < 2.2.0
...