【发布时间】:2021-01-29 01:29:37
【问题描述】:
我正在https://learnforge.autodesk.io/#/?id=learn-autodesk-forge 编写 Forge API 教程,但遇到了问题。我正在使用 .NET (C#) 示例并一直执行到最后,但是当我尝试运行该应用程序时出现错误。当我运行它时,我得到了我应该得到的登录页面
但是当我单击 AUTODESK 登录时,它会引发错误
Credentials 对象似乎被返回为 NULL。它调用来获取这个对象的代码如下:
public static async Task<Credentials> FromSessionAsync()
{
if (HttpContext.Current.Session == null ||
HttpContext.Current.Session["ForgeCredentials"] == null)
return null;
Credentials credentials = JsonConvert.DeserializeObject<Credentials>(HttpContext.Current.Session["ForgeCredentials"].ToString());
if (credentials.ExpiresAt < DateTime.Now) await credentials.RefreshAsync();
return credentials;
}
我不确定该代码块中会话凭据的来源。
我是 Forge API 的新手,因此我们将不胜感激。
谢谢 格里
【问题讨论】:
标签: c# autodesk-forge autodesk