我正在使用 Kentico V10,我可以在本地运行网站。但是,当我尝试从控制台应用程序使用 API 时,出现以下错误。
{"Object type 'cms.class' not found."}
stackTrace 有一个检查许可证的调用。我正在关注此页面,它说您必须为您的域添加许可证,但是当您从控制台应用程序运行时使用的是什么域?
https://docs.kentico.com/k10/integrating-3rd-party-systems/using-the-kentico-api-externally
我正在使用来自此页面的代码。 https://docs.kentico.com/k10/managing-users/user-registration-and-authentication/configuring-single-sign-on
CMS.DataEngine.CMSApplication.Init();
string userName = "myuser";
// Gets the user with the specified user name
UserInfo userInfo = UserInfoProvider.GetUserInfo(userName);
// Gets the authentication URL for a specified user and target URL
string url = AuthenticationHelper.GetUserAuthenticationUrl(userInfo, "SecuredSurvey");
如果可以通过 REST API 获得,我很乐意以这种方式获取 URL,但据我所知,它不可用。
-兰迪