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

Java Http request PUT : 401 unauthorized

I'm trying to send a PUT request from a Java app to a server. I successfully send GET, POST and DELETE requests but the PUT one won't succeed (I'm getting a 401 Error with the code below, 405 Error with an other code using the HttpPut of the apache…
Icedsky
  • 13
  • 4
-1
votes
1 answer

httpput authentication is not working

I am using below code to authenticate on server. DefaultHttpClient Client = new DefaultHttpClient(); Client.getCredentialsProvider().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials("username", "password")); HttpGet get = new…
NovusMobile
  • 1,813
  • 2
  • 21
  • 48
-1
votes
1 answer

Google is returning 401 Unauthorized (NAT Router)

When I try use f.e. google maps API, sometimes it is asking for login and password in the browser, and then it is returning 401 Unauthorized in the browser (Firefox 37). Then when I try to go to the www.google.com and try to search something, it is…
Legionar
  • 7,472
  • 2
  • 41
  • 70
-1
votes
1 answer

Send username and password using JSON to 401 HTTP Authentication

I have uploaded sqlite file to the server for the Android app to download whenever any change is made to the database. Now, I want to protect this file so that it not available when accessed using the public URL. The Android app sends username and…
-1
votes
1 answer

Cross-Domain ajax error with bearer authentication - 401 Unauthorized

So... i'm making a cross domain (CORS) call. When i initially make it on the page, it works just fine (noting that cross-domain issues aren't really a problem), but when i make another request later to the same server adding a bearer authorization…
-1
votes
2 answers

how to allow insecure content to be displayed on page

I am trying make AJAX request to external url and try to get Json data from that url. I am getting 401- Authorization error saying that its insecured content when try access the url. Here below is my code. Please advise function check() { var…
itdeveloper
  • 41
  • 2
  • 8
-2
votes
1 answer

YouTube API address is displaying invalid response when I tested using postman app for testing API

I tested the YouTube api url I got from rapid api and the status code was 401 - invalid address. I need help ls What else can I do?
-2
votes
2 answers

CORS problem with Passport.js implemented in Azure Function in Static Web App. Passport returns 401

I am working on a project which uses the Azure Static Web App offering. I have implemented a Passport.js authentication strategy powered by azure-function-express which receives a JWT in an Authentication header, validates the JWT, and returns user…
-2
votes
1 answer

ASP.NET CORE REST API (401 Unauthorized)

I'm getting troubles with the publishing of my REST API made in ASP.NET CORE. When I'm debugging my code in the localhost, it's all right. But when I want to publish it in IIS 10.0, I can navigate into the swagger UI. Nevertheless, if I want to use…
-2
votes
2 answers

I keep getting 401 Unauthorized whenever I try to login an existing user with JWT, Passport, and Express

Whenever I try to login a user through a post request in Postman, I keep getting this error: Here is the localStrategy I made for checking if a user's email and password can be verified: passport.use(new LocalStrategy({usernameField: 'email',…
MountainSlayer
  • 291
  • 1
  • 5
  • 14
-2
votes
1 answer

Facebook Like - Shows 401 Unauthorized Error

I am adding ShareThis widget. When i try to like the page it gives me an Error
Harsha M V
  • 54,075
  • 125
  • 354
  • 529
-3
votes
1 answer

401 error when performing GET request w/ axios

I can view my JSON data in my browser but not in my console. I'm not super familiar with axios, but I think the problem is with the url (see snippet below). That, or I'm missing something within axios.get {. Any…
Bodrov
  • 840
  • 1
  • 15
  • 29
-4
votes
1 answer

Unauthorized using jwt tokens

I've built my MEAN web application. To authorize users I'm using JWT tokens. But there is one problem. Sometimes while reloading page I get 401 Unauthorized while I'm still authorized. I checked twice my token in locale storage and it was right…
-5
votes
1 answer

How to Pretend to be an website in curl PHP?

so I built a scraper with PHP - curl. So I can build my API and integrate in my application. The problem is that I am getting blocked by the website in just one page. What my scraper does: First it goes to the website that have an iframe ( and this…
Evara
  • 73
  • 7
1 2 3
73
74