草庐IT

身份证

全部标签

c# - 如何使用带有摘要式身份验证和查询字符串的 WebClient.DownloadFile

如何将WebClient.DownloadFile与摘要式身份验证和查询字符串一起使用?当我尝试使用它时,我收到了401响应。这是Apache错误日志:[TueJun2417:31:492014][error][clientx.x.x.x]Digest:urimismatch-doesnotmatchrequest-uri以下是我尝试下载文件的方式:Uriuri=newUri("http://example.com/file-1.php?since=1403587422");WebClientwebClient=newWebClient();CredentialCachecredent

c# - 客户端身份验证方案 'Anonymous' 禁止 HTTP 请求。远程服务器返回错误 : (403) Forbidden

我正在尝试创建一个安全的网络服务。这里是合约和服务实现[ServiceContract()]publicinterfaceICalculatorService{[OperationContract()]intAdd(intx,inty);}[ServiceBehavior(IncludeExceptionDetailInFaults=true)]publicclassCalculatorService:ICalculatorService{publicintAdd(intx,inty){returnx+y;}}我这里有服务代码varb=newWSHttpBinding(Security

c# - 更改默认的 ASP.NET 身份双因素记住 Cookie 过期时间

我一直在使用ASP.NETIdentity2.2.1。以下是VerifyCodeAction的post方法中的代码。varresult=awaitSignInManager.TwoFactorSignInAsync(model.Provider,model.Code,isPersistent:model.RememberMe,rememberBrowser:model.RememberBrowser);switch(result){caseSignInStatus.Success:returnRedirectToAction("Dashboard","Index");caseSignI

c# - 如何使用 Windows 身份验证防止重复的 HTTP 请求

我正在开发基于WCF的客户端/服务器应用程序(WCF是自托管的,不在IIS中)。WCF服务有一个操作可以将一大块数据上传到服务器。契约(Contract)大致如下所示:voidUploadChunk(intclientId,byte[]chunk);我们正在使用Windows身份验证(Kerberos/NTLM),因此我们无法在此处使用流式传输。绑定(bind)看起来像这样(客户端和服务器端):newBasicHttpBinding{Security=newBasicHttpSecurity{Mode=BasicHttpSecurityMode.TransportCredentialO

c# - 从 WMI 运行 exe 时的网络身份验证

我有一个C#exe需要使用WMI运行并访问网络共享。但是,当我访问共享时,我得到一个UnauthorizedAccessException。如果我直接运行exe,共享是可以访问的。我在这两种情况下都使用相同的用户帐户。我的应用程序有两个部分,一个在本地PC上运行的GUI客户端和一个在远程PC上运行的后端进程。当客户端需要连接到后端时,它首先使用WMI(下面复制的代码)启动远程进程。远程进程执行许多操作,包括使用Directory.GetDirectories()访问网络共享并向客户端报告。当客户端使用WMI自动启动远程进程时,它无法访问网络共享。但是,如果我使用远程桌面连接到远程计算机

c# - 如何使用 HttpWebRequest.AllowAutoRedirect 处理身份验证?

根据MSDN,当HttpWebRequest.AllowAutoRedirect属性为真时,重定向将清除身份验证header。给出的解决方法是实现IAuthenticationModule来处理身份验证:TheAuthorizationheaderisclearedonauto-redirectsandHttpWebRequestautomaticallytriestore-authenticatetotheredirectedlocation.Inpractice,thismeansthatanapplicationcan'tputcustomauthenticationinform

c# - SQL Server 2008 R2 上的身份验证设置是否会对性能产生影响?

好的这是第一种方法publicstaticstringsrConnectionString="server=localhost;database=myDB;"+"uid=sa;pwd=myPW;";这是第二种方法publicstaticstringsrConnectionString="server=localhost;database=myDB;"+"integratedsecurity=SSPI;persistsecurityinfo=False;Trusted_Connection=Yes;";这两个连接字符串之间是否存在任何性能差异或任何其他差异?这里我的sql连接类有什么建议

c# - ASP.NET MVC5 基本 HTTP 身份验证和 AntiForgeryToken 异常

我正在开发启用了表单例份验证的ASP.NETMVC5项目。项目目前处于测试阶段,并在线托管在Azure上,但项目所有者希望禁用对该网站的所有公共(public)访问(因为网站的某些部分根本不需要用户进行身份验证)。对于这个测试阶段,我们决定从这个link实现基本的HTTP身份验证。.我更改了代码,因此它更适合我的需要:publicclassBasicAuthenticationAttribute:FilterAttribute,IAuthorizationFilter{publicstringBasicRealm{get;set;}protectedstringUsername{get

c# - 当子项具有身份 key 时,如何使用 EF 将多个子实体添加到对象?

我们正在使用EF5和SQLServer2012以下两个类:publicclassQuestion{publicQuestion(){this.Answers=newList();}publicintQuestionId{get;set;}publicstringTitle{get;set;}publicvirtualICollectionAnswers{get;set;}}publicclassAnswer{publicintAnswerId{get;set;}publicstringText{get;set;}publicintQuestionId{get;set;}publicvi

c# - 从 Google 身份验证服务为 .NET 中的 REST 服务检索新的 Firebase 访问 token

这个问题在这里已经有了答案:UsingCustomTokenstomakeRESTrequeststoFBDBasanadmin(2个答案)关闭6年前。更改firebase授权系统后,我正在尝试从googleauth服务器检索c#中的访问token。根据新文档:https://firebase.google.com/docs/reference/rest/database/user-auth#section-api-usage我在C#中创建了类似的东西:usingGoogle.Apis.Auth.OAuth2;[...]asyncTaskGetToken(){GoogleCredent