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

Java JBoss 401 Error on SharePoint 2010 Web Service

My code runs successfully when tested within the Eclipse IDE. I'm connecting to MS SharePoint 2010 via Web Services using the generated Copy.wsdl When I deploy my code on the JBoss server (Running Adobe LifeCycle) my code receives a 401…
7
votes
4 answers

Friendly HTTP 401 Status Code Message?

I'm a developer not a wordsmith and as such I'm stuck. We have a subscription based site whereby users may well come across our 401 page. We've decided that the IIS 401;2 page needs replacing. Does anyone have any examples or advise about writing a…
Ed Blackburn
  • 551
  • 1
  • 4
  • 11
7
votes
4 answers

Return 401 from WCF service

How can I return a HTTP 401 from a WCF service?
Nevin Mathai
  • 2,316
  • 13
  • 39
  • 54
7
votes
5 answers

401 Unauthorized error web api mvc windows authentication

I am getting 401 unauthorized error . My web service is written in mvc . in IIS configured to use windows authentication. Below is screen shot of fiddler When I hit URL from browser it gives me popup window to enter user name and password. How can…
GPK
  • 137
  • 1
  • 1
  • 11
7
votes
2 answers

SSRS Report Viewer + ASP.NET Credentials 401 Exception

I have a report saved on a SQL2005 reporting server, and I want to return a rendered PDF of this report. I've figured this out when working with a local *.rdlc file (and I've blogged about it), but not when the *.rdl resides on a reporting server. I…
Jarrett Meyer
  • 19,333
  • 6
  • 58
  • 52
6
votes
2 answers

Should a failed login attempt result in a http 401 response

Should a failed login attempt result in a HTTP 401 response? Doesn't seem like all the major sites do this.
kenwarner
  • 28,650
  • 28
  • 130
  • 173
6
votes
1 answer

AWS CodeArtifact: mvn deploy:deploy-file Failed to deploy artifacts: Could not transfer artifact 401 Unauthorized

I have an issue while trying to publish a java library (jar) to an AWS CodeArtifact Maven repository. I get HTTP Status code 401 (unauthorized) when I try to publish it. Which would indicate that I'm doing something wrong like a missing…
6
votes
1 answer

IIS asks for login credentials only on a specific folder

i have on IIS 7 a site which has several sub folders. the site was built using .net 2 and is running in a pool in integrated mode. the whole site works perfectly except for all aspx files under a folder called "Reports". when the user is trying to…
Dani Avni
  • 423
  • 5
  • 14
6
votes
1 answer

Spring Boot 2.0.3 Oauth2 Security: Getting 401 error even when using access token in header

I'm creating a spring boot 2.0 application and trying to enable oauth2 security. I have Auth server and Resource server in the same application as of now. My client and user details as well as token generated are persisted in databases (mysql) and…
6
votes
0 answers

Microsoft Edge multiple windows auth pop ups for each api request

We use Basic Auth for the login system of our web product. Normally, when an Api call is made from the web and no authentication is present, the browser (Chrome, Firefox, or IE) would prompt for a Windows Security alert or pop up to ask for the user…
6
votes
2 answers

PHP Digest auth, logout

Is there a way to logout of a digest authentication done in php. I have tried unset($_SERVER["PHP_AUTH_DIGEST"]); But it wont ask to relogin. I know if i close the browser then it will work and here are my functions. function login(){ …
6
votes
0 answers

Call authorized Web API using WebClient

After hours of searching the internet I decided to ask you guys for a little help. I've written an Web API with couple of simple get/post methods. I'm using Individual user accounts authentication method. Using the HttpClient I've managed to…
6
votes
0 answers

NGINX basic authentication - redirect to home page on 401 authentication error

I would like to redirect to my home page again if the authentication failed, since the authentication fails with basic authentication from ngnix even if you press cancel and do not even try to authenticate. If I do it the way shown in the…
6
votes
1 answer

rails devise 401 unauthorized for a specific page

I'm having trouble discerning why my app is returning a 401 Unauthorized. Other actions in my Institutions controller are working just fine while not signed in. However, this and another page are returning 401. If logged in, these pages work…
Michael
  • 1,786
  • 5
  • 23
  • 42
6
votes
2 answers

Sending message with 401: Asp.net Web-api

I am in asp.net web API. In login method I check the user/password against the db and if they do not match, I return 401 status code along with invalid user or password method like var content = new StringContent("Invalid user name or…