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
0 answers

401 GET Error Trying to access Spotify tracks href

I am trying to access tracks from a playlist with xinranxiao:spotify-web-api for MeteorJS. I sign in with a spotify account and am able to access data from spotify api. I am able to obtain users playlists, tracks, and artists etc. However If I try…
Felice
  • 571
  • 1
  • 7
  • 22
2
votes
1 answer

401 Authentication error while running C# Application executing HttpWebRequest

I would like to know how can I fix this issue wherein a WebApp running on IIS 7/8 with Windows Authentication is throwing 401 error while executing HttpWebRequest to another site. This WebApp works fine if I run it locally i.e debug mode. Here is…
Joms
  • 21
  • 3
2
votes
1 answer

Best way to handle unauthenticated request in asp.net Web Api

I have a standard VS2013 MVC5 project with a Web Api 2 in it. The way the standard project is designed, the [Authorize] attributes simply return a 401 status code if the request is not authenticated, while a totally separate module sniffs for any…
Matthew
  • 4,149
  • 2
  • 26
  • 53
2
votes
0 answers

Android 4.1.2 connection.getResponseCode() returns IOException wrongly

I'm using Volley in my app to make HTTP calls to my rest server. When a user is not authenticated (no SESSION ID cookie) the server returns a 401. But with Android 4.1.2 (with Android higher that 4.2.2 I don't have this problem) the calls fails with…
Johny19
  • 5,364
  • 14
  • 61
  • 99
2
votes
1 answer

Migrating Spring Security 3.1 with XML config to 4.0.1 with Java config causes HTTP Status 401 - Authentication Failed: Bad credentials

My spring security is not working. I migrate from spring-security xml config file (version 3.1) to java config(version 4.0.1). As soon as I login it gives me this page : HTTP Status 401 - Authentication Failed: Bad credentials I will post my…
2
votes
1 answer

How to response status 401 on ASP.NET 5 ASP.NET Identity 3.0 RC1

In all tutorials that I use the code app.UseCookieAuthentication(ctx => { ctx.AutomaticChallenge = true; ctx.Events = new CookieAuthenticationEvents() { …
2
votes
3 answers

The remote server returned an error: (401) Unauthorized

I am extracting gmail contacts using opencontactsnet. I get The remote server returned an error: (401) Unauthorized. when executing this line HttpWebResponse exportResponse = ( HttpWebResponse ) contactsRequest.GetResponse(); using System; using…
ACP
  • 34,682
  • 100
  • 231
  • 371
2
votes
0 answers

AFNetwork 2.0 dealing with 401

Is there a way to deal with 401 and refresh token using AFNetwork 2.0 in a centralized way? I'm able to solve the problem with my on implementation of AFHTTPSessionManager. I did overriding the dataTaskWithRequest:completionHandler: method to retry…
2
votes
1 answer

How to temporarily run file in app directory in Magento?

I have file in app/code/local/MyModule/SalesXLSXExport/model/cron.php This file is run every day with cron: 0 8,15 * * php -f /var/www/website/app/code/local/MyModule/SalesXLSXExport/model/observer.php >/dev/null 2>&1 and its working, but I would…
2
votes
1 answer

webMethods getting the root cause for a ServiceException

I get the following exception when calling the http service: com.wm.app.b2b.server.ServiceException Message: com.wm.net.NetException: [ISC.0064.9314] Authorization Required: Unauthorized So far, so good. But I would like to get that information…
eventhorizon
  • 2,977
  • 8
  • 33
  • 57
2
votes
0 answers

NGINX | NetworkError: 401 Unauthorized ~ but it works?

I've a really strange issue mostly with images and sometimes with URLs, too. (on my NGINX setup) Sometimes I find following message in the console of Firebug the message: "NetworkError: 401 Unauthorized -…
Sascha
  • 615
  • 1
  • 9
  • 20
2
votes
0 answers

Rails before_action :authenticate_user! not redirecting

Context: I'm using Devise for authentication. I am trying to test the behavior that a user has multiple windows open after they sign in, then they log out of one window but try to make a change on another that requires authentication. When they…
james
  • 3,989
  • 8
  • 47
  • 102
2
votes
1 answer

Get data on error with HttpWebRequest

While interacting with an API there is a situation where they will return a 401 response that also contains data. I would like to return this data regardless of the error code of the response. I have created a function to submit a either a GET or…
Spaceman Spiff
  • 934
  • 1
  • 14
  • 32
2
votes
2 answers

Avoid 401 popup with Wildfly server and Basic Authentication

We've got a JQuery web app and a JAX-RS-based backend running on Wildfly 8. The application uses Basic authentication with a custom DatabaseServerLoginModule, which in turn implements PBKDF2 for password hashing. Each request is authenticated in…
2
votes
0 answers

Twitter streaming API - Error 401 Unauthorized

Running a java main program to call twitter streaming api. I have generated a bearer token and passing to the api. But getting the error response Error 401 Unauthorized Is passing the bearer token right way to authenticate? If not what is the right…
user3755282
  • 813
  • 2
  • 9
  • 15