访问路径“C:\Windows\system32\config\systemprofile”被拒绝 [英] Access to the path 'C:\Windows\system32\config\systemprofile' is denied
问题描述
我正在使用 Google Calendar Api
和我的一个项目。我不知道如何,但显示下面的错误是麻烦。
以上解决方案不适用于我,如果有任何答案,请帮助。
根据 https://domantasjovaisas.wordpress.com/2014/09/27/demystifying-google-api-and- oauth2 / :
从我刚刚提供的代码可以看出,我正在使用File2DataStore。
它被我覆盖。标准FileDataStore我改为我自己的
需求。标准FileDataStore将授权密钥存储在
C:\WINDOWS\system32\config\systemprofile\AppData\Roaming\Drive.Api.Auth.Store中。
我认为您不会允许IIS_IUSRS用户在生产环境中访问此
位置I am using
Google Calendar Api
with one of my project. I don't know how but Error Shown Below is troubling.Code inside
AppFlowMetadata
.public class AppFlowMetadata : FlowMetadata { private static readonly IAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow(new GoogleAuthorizationCodeFlow.Initializer { ClientSecrets = new ClientSecrets { ClientId = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com", ClientSecret = "xxxxx_xxxxxxxxxxxxxxxxx" }, Scopes = new[] { CalendarService.Scope.Calendar }, DataStore = new FileDataStore("Calendar.Api.Auth.Store") }); public override string GetUserId(Controller controller) { var user = controller.Session["UserID"]; if (user == null) { user = Guid.NewGuid(); controller.Session["UserID"] = user; } return user.ToString(); } public override IAuthorizationCodeFlow Flow { get { return flow; } } }
I tried below solution from GitHub but isn't working
Above solution didn't worked for me, if any have the answer please help.
解决方案As per https://domantasjovaisas.wordpress.com/2014/09/27/demystifying-google-api-and-oauth2/ :
From code I just provided you can see that I’m using File2DataStore. It’s overridden by me. Standard FileDataStore I changed to my own needs. Standard FileDataStore stores auth keys in "C:\WINDOWS\system32\config\systemprofile\AppData\Roaming\Drive.Api.Auth.Store"
I don’t think so that you will allow IIS_IUSRS users access this location in production environment
这篇关于访问路径“C:\Windows\system32\config\systemprofile”被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!