I am working on the Forge API tutorial at https://learnforge.autodesk.io/#/?id=learn-autodesk-forge but am having an issue. I am using the .NET (C#) examples and have followed through to the end but when I try to run the app it gives an error. When I run it I get the login page as I am supposed to
But when I click AUTODESK Sign In it throws an error
It appears the Credentials object is being returned as NULL. The code it is calling to get this object is as follows:
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;
}
I am not sure where the session Credentials are coming from in that block of code.
I am new to the Forge API so any help will be greatly appreciated.
Thanks Gerry