Questions tagged [http-status-code-401]

Similar to 403 Forbidden, but specifically for use when authentication is possible but has failed or not yet been provided. The response must include a WWW-Authenticate header field containing a challenge applicable to the requested resource.

The request has not been applied because it lacks valid authentication credentials for the target resource.

The server generating a 401 response MUST send a WWW-Authenticate header field1 containing at least one challenge applicable to the target resource.

If the request included authentication credentials, then the 401 response indicates that authorization has been refused for those credentials. The user agent MAY repeat the request with a new or replaced Authorization header field2. If the 401 response contains the same challenge as the prior response, and the user agent has already attempted authentication at least once, then the user agent SHOULD present the enclosed representation to the user, since it usually contains relevant diagnostic information.

See

1109 questions
5
votes
2 answers

curl 401 Unauthorized error

As shown in image when i am trying to run https://www.example.com/Push_Order.php?orderId=1562 It gives me 401 Unathorized error. But when I run this Url in browser it run well. Any Idea where is my mistake or what i am missing? PHP Curl Code…
Jaydeep Pandya
  • 825
  • 1
  • 10
  • 25
5
votes
1 answer

401 Unauthorized Error On SSRS URL Access ... but it works in Fiddler?

I am attempting to generate a pdf from a SSRS report using URL Access in C#. (In the business layer behind a WebApi Controller) I create an instance of the HttpClient, assign correct credentials and form the request URL…
Cos Callis
  • 5,051
  • 3
  • 30
  • 57
5
votes
2 answers

Azure Scheduler fails to trigger OnDemand WebJob published with WebApp

Some time ago, I used Visual Studio (2015) to create a WebApp, a console app and link that console app as OnDemand WebJob to the WebApp. I published the whole to Azure and the website, the WebJob and the Scheduler Job worked perfectly. Last week, I…
Erik123
  • 201
  • 1
  • 2
  • 8
5
votes
1 answer

SignalR asks for authentication credentials with 401

I have a .Net 4.5 website with MVC, Web API, and SignalR, and using Windows authentication. Everything runs great until I add the hubs to my HTML with: @Scripts.Render("~/signalr/hubs") With this line in place, about 1/3 of the time when I hit F5…
user47589
5
votes
4 answers

Doorkeeper gives 401 Unauthorized

i am using doorkeeper gem my ApplicationController look like this: private def current_resource_owner Person.find(doorkeeper_token.resource_owner_id) if doorkeeper_token end my DemosController look like this: doorkeeper_for :index respond_to…
5
votes
1 answer

What does mean "authorization will not help" in the HTTP spec for error 403?

The HTTP 1.1 spec says: 10.4.4 403 Forbidden The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. [...] Does this mean only "basic authorization", as in…
5
votes
3 answers

ApplicationPoolIdentity in IIS7 401 errors

We have just started to use Windows Server 2008 R2 and IIS7.5 and I'm trying to move some existing sites across from our Windows 2003 box. I can get the sites running ok but am getting 401 errors for all the CSS / Images in the sites. Granting…
Simon Martin
  • 4,203
  • 7
  • 56
  • 93
5
votes
2 answers

Custom 401 page not prompting for credentials on nginx

I have a part of my website protected by auth_basic : location / { auth_basic "Authorization Required"; auth_basic_user_file .htpasswd; index app.php; try_files $uri @rewriteapp; } For…
Julien
  • 9,312
  • 10
  • 63
  • 86
5
votes
2 answers

Google Drive Python API resumable upload error 401 after 2 hours

First of all, I'm sorry if this is a too silly question... this is the first time I'm trying to use any of the technologies involved in this script (Python, the drive api, oauth 2.0, etc). I swear I've been searching and trying this for about a week…
5
votes
2 answers

JAVA: Cannot read body from a 401

I'm using java's HttpUrlConnection (using POST) to make a very simple rest client. The server accepts and replies aplication/xml. Even for error situations (status code 3xx, 4xx, 5xx) it sends xml payload - as specified by this server implementation…
Miguel Ribeiro
  • 8,057
  • 20
  • 51
  • 74
5
votes
1 answer

Error 401 Unauthorized (Invalid OAuth Token) during AppEngine Deployment with Eclipse Plugin

I'm trying to deploy a fairly large app over an unfortunately fairly slow internet connection from within Eclipse. After something like 15-30 minutes during the file-upload, the deploy process aborts with a 401 Unauthorized (Invalid OAuth Token)…
Markus A.
  • 12,349
  • 8
  • 52
  • 116
4
votes
1 answer

Twitter stream using OAuth in Python behaving differently on two equally configured machines

I have the same piece of coding to deal with Twitter User Stream running on two different machines. Both machines are Ubuntu Lucid using python 2.6.5, but on the machine in my home I receive HTTP Error 401: Unauthorized while on the university it…
Eduardo
  • 4,282
  • 2
  • 49
  • 63
4
votes
1 answer

Calling asp.net asmx webservice via ajax returns 401 Unauthorized error

There's an asmx: [WebService] [ScriptService] public class MyService : WebService { [WebMethod] public OperationResult Validate(string str) { } } There's a https://.../a.aspx, in this page, I call the webserivce via jQuery ajax: $.ajax({ …
Mouhong Lin
  • 4,402
  • 4
  • 33
  • 48
4
votes
1 answer

How redirect user if error.status == 401?

My goal is to redirect users if the code of request is equal to 401. I wrote follow code but it display me error 401. It displays me 401 (from console.log but below error). How can I implement redirection, if the error is equal to 401? import…
KaKi786
  • 53
  • 1
  • 2
  • 6
4
votes
1 answer

Why do I get a 401 error when I enable csrf?

So I am working on my first full-stack application (spring boot rest API and Vue.js frontend) and I came across a problem by using sonarqube. My sonarqube gives the following warning: Make sure disabling Spring Security's CSRF protection is safe…
LardinoisJosse
  • 363
  • 2
  • 5
  • 22