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
2
votes
1 answer

Angular $http GET pass authorization

Is it possible to pass a user and password to basic auth in AngularJS? I am using a $http to make the request : var urlsave = myurl; $http({method: 'GET', url: urlsave}).success(function(data) { console.log(data); }) This is the…
Gaz Smith
  • 1,100
  • 1
  • 16
  • 30
2
votes
2 answers

Stripe 401 - No valid API key provided - C#

I get following error: "The remote server returned an error: (401) Unauthorized" in this line: using (HttpWebResponse httpResponse = request.GetResponse() as HttpWebResponse) {} Here is the complete code: string clientSecretKey =…
Nil
  • 129
  • 4
  • 11
2
votes
3 answers

Is it possible to listen all Ajax calls?

What I need is to redirect to a certain url when an error 401 (Unauthorized) response is received. I have several Ajax calls in my code so I am wondering if there is a general way to listen to all of them and only when that code is returned then…
andres.gtz
  • 624
  • 12
  • 22
2
votes
2 answers

Symfony + AngularJS 401 unauthorized error after Get method

I have some concerns(marigolds) with my method GET when I send my request. I have received an error 401 and I am disconnected from the application, knowing that the token which I obtain in the console is very valid when I test on postman. I does not…
2
votes
2 answers

grails spring security rest /api/login 401 Unauthorized

I have configured a Grails(2.3.7) app using spring-security-core:2.0.0 + spring-security-rest:1.4.1 plugins in order to have two auth types, a statefull auth for web and one for mobile using tokens(stateless). All good, basic http auth is working…
2
votes
1 answer

IIS 7.5 401 only from Windows Service

I have a simple webservice running on IIS 7.5. When accessing the webservice from an external PC everything works fine. When my windows service tries to access the webservice the service gets a 401 - unauthorized error message. The windows service…
2
votes
1 answer

HTTP Status Code for Authenticated but Unauthorized?

With which HTTP status code should a REST API respond if the request is authenticated (according to The OAuth 2.0 Authorization Framework: Bearer Token Usage: Authorization Request Header Field) but the authenticated user is unauthorized to view the…
ma11hew28
  • 121,420
  • 116
  • 450
  • 651
2
votes
1 answer

How to send multipart/formData in upload file post call in Apache - CXF client?

Hi I am working in upload api in my project . I am able to send data and get response using jersy client. I am getting 200 as Response . Here is that code . final Client client =…
Ramesh
  • 1,872
  • 2
  • 20
  • 33
2
votes
0 answers

How should I configure Turbolinks to handle a 401 return code?

If you attempt to sign with invalid credentials, you get a 401. Turbolinks isn't showing the HTML on that page with the validation error. Shouldn't it be? Do I need to configure ajax.failure to replace the HTML?
Eric
  • 5,815
  • 3
  • 25
  • 34
2
votes
1 answer

NSURLSession: Getting 401 HTTP error

I am getting "401 Unauthorized access to the endpoint". When I run the same call on POSTMAN (Chrome Extension), it works fine. Even it works fine in my Android app. But here, I am getting the unauthorized access even if I am sending token in…
2
votes
1 answer

Amazon MWS Products API returns 401 error "Access denied"

I'm hopelessly stuck on trying to call Amazon MWS Products API. Particularly I'm trying to request this function It requires building a pretty complicated request with a signature: POST /Products/2011-10-01 HTTP/1.1 Content-Type:…
2
votes
2 answers

IIS7 - 401 Unauthorized error while reading external xml file from a swf (flash)

I am getting a 401 unauthorized error when I try to read an XML file from a flash SWF file in IIS7. The file is located right next to the SWF file in the file system. When I browse to the XML file through the browser, I get the following: HTTP…
Emon
  • 801
  • 9
  • 26
2
votes
1 answer

How do I test for 401 response to a post request in python?

I'm using a post request to access a website that requires authentication. If that authentication is incorrect, I get a Response [401]. I want to test if the authentication is incorrect and if so, abort the process and display an error of some sort.…
C Van Ort
  • 29
  • 1
  • 4
2
votes
1 answer

Python Gspread 401 error after a period of time

I am trying to write a program to grab stats i have recorded in google spreadsheets and write them to a text file to be read and displayed on a stream. The program works fine for the most part but every once in a while it crashes with the…
TheTrooble
  • 53
  • 9
2
votes
1 answer

expire or redirect http of 401 for mod_auth_openidc

I'm not sure if this is something handled in OIDC or apache in general but what I'm seeing is this and was hoping for some advice: A customer is logged into multiple Google accounts and at the Account Chooser they click the wrong account they get a…