I'm having trouble getting access to some folders, when I have to validate an authentication for a Google user.
Im getting the error: Access to the path '..' is denied
when I've published locally on the IIS.
I tried to change the folder location, so it would be in the App_Data of the project - no luck.
I have also tried to do what these guys are doing, but didnt help as well.
My code looks like:
string path = AppDomain.CurrentDomain.BaseDirectory + @"\Json\client_secrets.json";
using (var stream = new FileStream(path, FileMode.Open, FileAccess.Read))
{
try
{
string googlecalendarpath = folderpath + @"\App_Data\GoogleCalendar";
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets, scopes,
_currentAccountNo,
//Vær sikker på, at dette er det samme altid, og er unikt, da ens permissions til Google Calendar bliver bundet op på dette!
CancellationToken.None, new FileDataStore(googlecalendarpath)).Result;
}
catch (Exception ex)
{
return "Cred. FEJL: " +ex.GetFullExceptionString();
}
}
, where folderpath
is from Server.MapPath("~/App_Data")
, and _currentAccountNo
is unique.
I cannot see what i'm missing when following the examples online, and can't see what I'm doing wrong.
- thanks