问题标签 [unauthorized]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
6146 浏览

c# - App_Data 没有访问权限

我正在完成我的网络项目并添加了一些错误日志功能。它在 App_Data 文件夹中的日期文件中写入异常的详细信息。

当我在我的开发机器上执行此操作时,它可以工作。但是当我切换到我的 IIS 机器时,它停止工作并且我得到一个 UnauthorizedAccessException。

堆栈跟踪:

代码:

在错误详细信息中,它告诉我需要为此文件夹设置 IUSR_MachineName 的权限,但我不确定这是否是一个好主意或如何在 IIS 5.1(我正在使用)中执行此操作。

0 投票
2 回答
738 浏览

api - Status code: Unauthorized when using https://appcenter.intuit.com/Playground/API and my own scripts

Quickbooks API simply does not work for me. Using their own API exporer it wont even work (get internalserver errors and unauthorized errors. Basically I can only do things in https ://developer.intuit.com/apiexplorer successfully but when doing it using their other API tool it fails with the mentioned errors. As well as my own scripts error out the same exact way.

Also note that I can call to anything using the API inside of my script to the domain of https: //appcenter.intuit.com/api but nothing to the domain of https: //qbo.intuit.com/qbo32 (note that the appcenter is a simple get request however and the other is a complex post request).

Example of what I do to duplicate:

  • Goto https: //appcenter.intuit.com/Playground/OAuth and fill out consumer key and secret with my app info from https: //developer.intuit.com/Application/Manage
  • Click request token using key and secret and it returns key and secret
  • Authorize request Token button which then takes me through the popup which then I authorize access
  • Now I have access token and secret and then i goto the api console
  • Now at api console at https: //appcenter.intuit.com/Playground/API and i see my 4 keys included
  • I run a test by doing a GET request to https: //appcenter.intuit.com/api/v1/user/current with no params and it shows my user
  • I then try and do a POST to something like https: //qbo.intuit.com/qbo32/resource/invoices/v2/169115718 and the URL params of PageNum=1&ResultsPerPage=1 and then call API
  • It returns "Status code: Unauthorized", and if I omit the URL params it then says "Status code: InternalServerError"

I have spend 2 days on this and have no solution using every available tool including calling support. Keep in mind also that this same situation and messages exists in my own code as well. This is just the easier to troubleshoot method because I assume if we fix this, then my code may work with similar changes.

PS: I added a space into the urls because this tool would not let me make them clickable for you

Any ideas?

0 投票
1 回答
1898 浏览

python - Twitter Streaming API 未经授权

我从 twitter 流 api 获取推文时遇到问题:https ://stream.twitter.com/1.1/statuses/filter.json

我总是收到错误 401,未经授权。服务器时间正确。

我已经签署了请求。这是我的代码(python):

我究竟做错了什么?

请帮我。

在此先感谢,萨布丽娜

0 投票
4 回答
28204 浏览

angularjs - AngularJS 中的 401 未经授权的错误处理

我是 AngularJS 的新手,现在花了 3 天时间寻找处理 401 状态的方法。我试过拦截器,使用 $http,使用 $resource ......但没有任何效果。我的应用在同一台服务器上调用 JSONP 调用。当错误发生时,它会被错误回调函数捕获。但状态始终为 0,响应未定义。

首先,我尝试了这个拦截器

其次,也在使用 $resource 的控制器中尝试过

第三,尝试使用 $http 而不是 $resource

这是 JSONP 调用的标头信息

我找不到处理未经授权状态 401 的方法,但我把所有东西都绑起来了。如果我能得到小费或善意的建议,将不胜感激。

0 投票
0 回答
223 浏览

ios - iOS 在 App 级别拦截 HTTP 401 请求

我的 iPhone/iPad 应用程序严重依赖 OAuth 2.0 不记名令牌来与 JSON Web api 对话。

无论如何,对于 HTTP 401 消息(未经授权的又名未经身份验证的请求)有一个应用程序范围的句柄吗?

例如,如果我的 API 返回 HTTP 状态 401 消息,我希望应用程序转到登录页面。

编辑:我正在使用 AFNetworking

0 投票
3 回答
123 浏览

c# - 使 cd/dvd 上的文件无法访问

我有一个困难的用例。

例如,我在一张 CD 上有 20 个 pdf 文件以及一个用于打开这些文件的程序。但我希望使用该程序的用户无法从文件系统打开 pdf 文件。只有程序才能打开这些文件(在用户输入密码打开“存档”后)

我不知道如何开始,希望有人能给我一个提示或指针。

提前谢谢你们。

0 投票
0 回答
2094 浏览

c# - 为 SQL Server 报告服务 (SSRS) Web 服务提供域凭据?

我正在尝试提供特定的域凭据来访问我的报告服务器上的报告。如果我使用默认凭据(不提供实际信用),它可以正常工作,因为我可以访问我的报表服务器。一旦我硬编码我的凭据(并禁用默认凭据),它就会给我一个 401 异常(请求失败,HTTP 状态 401:未授权。)

comboBox1 是一个组合框(显然),每个服务器都可用

urlText 是 Web 服务 url 的文本字段

据我所知,这应该是所需要的。这可能与 rsreportserver.config 有关。就像现在一样,通过网络界面不会提示输入凭据(我不知道这是否重要,只是更多信息)。

这是认证部分

0 投票
0 回答
656 浏览

asp.net-mvc - VS2012 Web 项目在 VS Dev Server 中运行,但不在 IIS 中

我有一个继承的 MVC v3 项目。(我对网络东西不太熟悉。)该项目使用 Visual Studio 开发服务器在调试模式下运行良好。

但是,每当我尝试在本地通过 IIS 运行它时,它都会失败并显示401.0 Unauthorized。“您无权查看此目录或页面”

我已阅读页面和页面并尝试了许多无济于事的选项,例如:

  • 将以下用户配置为完全控制我的代码项目文件夹(Everyone、IUSR、NETWORK SERVICE、ASP.NET、me、IIS_IUSRS、DefaultAppPool)
  • 检查我<modules runAllManagedModulesForAllRequests="true">在 web.config
  • 使用 .NET v4 / Integrated 配置应用程序池。
  • 使用端口 81 和我的自定义应用程序池在 IIS 管理器中配置了一个新站点
  • 尝试通过身份验证或将自己指定为特定用户。

该错误发生在 IE、Chrome 和 FF 中。

详细的错误信息

环境

Windows 7 旗舰版,VS2012,IIS7.5

我没有多少头发要拔了。知道为什么这不在 IIS 中运行吗?

0 投票
1 回答
1783 浏览

ruby-on-rails - Rails 中带有 Doorkeeper 的自定义 401 页面

我有一个使用 Doorkeeper 的 Rails 4 应用程序,要求在大多数控制器中进行身份验证。当我去其中一条受限路线时,我看到一个空白页。我注意到在我的终端上,Puma 说:

过滤器链因 #Proc:0x007fd650803350@/.../doorkeeper-0.7.2/lib/doorkeeper/helpers/filter.rb:8 呈现或重定向而停止 401 Unauthorized in 1ms (ActiveRecord: 0.0ms)

如何捕获此类 401 Unauthorized 错误,以便显示自定义页面?我的目标是呈现 JSON 响应,其中包含有关如何进行身份验证的消息,而不仅仅是显示空白页。

0 投票
0 回答
2579 浏览

android - SELinux 在 4.2.2 上使用 Android USB Host 强制关闭我们的应用程序

在带有 4.2.2 的三星 Galaxy 4 上,我们的应用程序开始出现以下错误(注意(它在运行 4.0.1 的 Galaxy III 上运行良好):-

“应用程序因未经授权尝试访问您设备中的系统而被迫停止。这可能是由于......损害了您设备的内核”。

和一个 SEAndroid 明星通知“该应用程序因软件的未经授权的行为而被迫停止。这可能..”

我们的应用程序死了:(

我们已经在运行 4.2.2 的三星 Galaxy 4 上对此进行了调试,当我们在我们一直使用的设备上调用标准 Android USB 主机 api - UsbManager openDevice() (参见下面的三行代码)时,会发生强制关闭和错误通知由“android.hardware.usb.action.USB_DEVICE_ATTACHED”intent 传递,我们的 Activity 为其设置了一个 Intent 过滤器,因此有权使用(在这种情况下,请参阅 Android 文档中有关自动权限的摘录)。...

这是 SELinux 的已知问题还是三星最新的安全策略更新?有解决办法或解决办法吗?

从 Android 文档中提取:- 获得与设备通信的权限 在与 USB 设备通信之前,您的应用程序必须获得用户的许可。注意:如果您的应用程序使用 Intent 过滤器在 USB 设备连接时发现它们,如果用户允许您的应用程序处理该 Intent,它会自动获得许可。如果没有,您必须在连接到设备之前在您的应用程序中明确请求权限。