Symptoms
The following error was thrown when trying to set up Manage Site Realms in K2 for ADFS configuration
Specified cast is not valid.
•Type: SourceCode.SmartObjects.Client.SmartObjectException
•Source: SourceCode.SmartObjects.Client
•Method Base
◦Member Type: Method
◦Name: GetSmartObjectReader
◦Module
Scope Name: SourceCode.SmartObjects.Client.dll
◦Declaring Type
Full Name: SourceCode.SmartObjects.Client.SmartObjectClientServer
•Stack Trace:
at SourceCode.SmartObjects.Client.SmartObjectClientServer.GetSmartObjectReader(SmartObject smartObject, ExecuteListReaderOptions options, Dictionary`2and propertyReference)
at SourceCode.SmartObjects.Client.SmartObjectClientServer.ExecuteListReader(SmartObject smartObject, ExecuteListReaderOptions options)
at SourceCode.Forms.AppFramework.FormsApiToXml.ToXmlList()
at SourceCode.Forms.AppFramework.FormRuntime.SmartObjectExecution(XPathNavigator nav, Boolean outputDependencies, SmartObjectClientServer svr)
at SourceCode.Forms.AppFramework.FormRuntime.WorkXmlToApi(String xml)
at SourceCode.Forms.Runtime.AJAXCall.ProcessRequest(HttpContext context)
Diagnoses
A check of the claims tables in the db revealed that the realms needed had not been configured with issuers. This script will show the claims tables.
SELECT * FROM bK2].
Resolution
The solution requires direct manipulation of the K2 db. Please contact K2 support.