jjzjj

UnAuthorized

全部标签

c# - 使用 Bearer token 时,具有 AD 身份验证的 Azure Function 导致 401 Unauthorized

我在C#中有一个非常简单的Azure函数,我已经为其设置了AzureAD身份验证。我刚刚使用Express设置在功能配置中创建了应用程序注册。publicstaticclassIsAuthenticated{[FunctionName("IsAuthenticated")]publicstaticasyncTaskRun([HttpTrigger(AuthorizationLevel.Anonymous,"get","options",Route=null)]HttpRequestreq,ILoggerlog){returnnewOkObjectResult("Youare"+req.

c# - 远程服务器返回错误 : (401) Unauthorized

我正在尝试获取某个网页的html代码,我有一个正确的用户名和密码,但我仍然无法使用它,这是我的代码:privatevoidbuttondownloadfile_Click(objectsender,EventArgse){NetworkCredentialsnc=newNetworkCredentials("?","?","http://cdrs.globalpopsvoip.com/0000069/20091229/20091228_20091228.CDR");WebClientclient=newWebClient();client.Credentials=nc;Stringht

c# - WebRequest.GetResponse() 抛出错误 401 : Unauthorized

我有一个ASP.NET应用程序,我试图将以前访问过的本地aspx页面输出到html(它是一个报告,我想将它的静态html副本存储为存档)。我将本地页面的uri存储为:Session["SummaryURI"]=Request.Url.AbsoluteUri;然后在下一页中我检索它:stringurl=Session["SummaryURI"].ToString();url=url.Replace("static=false","static=true");//MessageLabel.Text=url;//CREATETHENEWFILEWebRequestreq=WebRequest

javascript - Web 推送通知 'UnauthorizedRegistration' 或 'Gone' 或 'Unauthorized' - 订阅到期

我为我的网站开发了推送通知服务。服务人员是:'usestrict';self.addEventListener('push',function(event){varmsg={};if(event.data){msg=event.data.json();}letnotificationTitle=msg.title;constnotificationOptions={body:msg.body,//bodydir:'rtl',//directionicon:msg.icon,//imagedata:{url:msg.url,//click},};event.waitUntil(Promi

javascript - 您如何将状态 401 从 WebAPI 返回到 AngularJS 并包含自定义消息?

在我的WebAPI类ApiController中,我进行如下调用:stringmyCustomMessage=.....;thrownewHttpResponseException(newHttpResponseMessage(HttpStatusCode.Unauthorized){ReasonPhrase=myCustomMessage});当我使用AngularJS$resource服务调用时,我确实在响应的状态字段中得到401,在promise的catchblock中。401匹配HttpStatusCode.Unauthorized,所以一切正常。但是,问题在于响应的数据字段为

php - 谷歌-api-php-客户端 "error": "unauthorized_client"

我们正在尝试构建一项服务,以在我们的gsuite域中导出googledrive文件。我们正在使用https://github.com/google/google-api-php-client我们创建了一个服务用户,下载并保存了用户凭证,并授予服务用户全域访问权限。下面是最简单的例子(就像我发现的每个文档一样):putenv('GOOGLE_APPLICATION_CREDENTIALS='/service-account-credentials.json');$client=new\Google_Client();$client->setAuthConfig('service-acco

php - 进行 Google plus API 调用时收到 HTTP 401 Unauthorized

我正在尝试通过API从Googleplus获取我所有好友的列表。我代表其执行此操作的用户先前授权了我的请求,并且我获得了授权token。我在php中尝试了以下代码:functionCallAPI(){$opts=array("http"=>array("method"=>"GET"));$url='https://www.googleapis.com/plus/v1/people/me/people/visible?key=XXXX';$context=stream_context_create($opts);$response=file_get_contents($url,false

php - 拉维尔 5.5 : Authorization Policy AccessDeniedHttpException This action is unauthorized

我创建了一个授权策略,所以我遇到了这个问题。我已经看到了这些解决方案,但我的问题还没有解决:Solution1Solution2Solution3代码如下:ArticalesController类中使用的函数:publicfunctionshow(Articale$articale){$this->authorize('view',$articale);returnview('articales.show',compact('articale'));}ArticalePolicy类:id==$articale->user_id;}AuthServiceProvider类:namespa

php - 随机获取云存储错误 : UNAUTHORIZED

今天,我开始收到此错误,据我所知,没有任何原因。这不是一个一致的错误。今天突然开始了。它昨天运行完美,并且几个星期都没有任何错误。文件中只有file_get_contents()。一段时间以来,我一直在为get_image.php使用相同的代码,但直到现在我才收到此错误。有谁知道为什么这会随机发生而不是持续发生?[20/Feb/2015:10:53:53-0800]"POST/get_imageHTTP/1.1"200149--"website.com"ms=296cpu_ms=86cpm_usd=0.000017pending_ms=160instance=app_engine_re

php - Google 云端硬盘服务帐户和 "Unauthorized client or scope in request"

我有3个使用DriveSDK的服务帐户。1,有效,2无效。返回的错误是“ErrorrefreshingtheOAuth2token,message:'{"error":"unauthorized_client","error_description":"Unauthorizedclientorscopeinrequest."}'"所有3个帐户都已在开发者控制台中注册。所有3个都被授权在GoogleApps控制台中进行“ManagedClientAPIaccess”。所有3个都有范围“https://www.googleapis.com/auth/drive.readonly”。所有3个