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

Login-Window on anonymous access in sharepoint

Whenever we deploy our sharepoint website we have pages that show a login-window to anonymous users (and after that a 401 if the user does not login). This login-window disappears once we login from any machine. After that: The anonymous users can…
Ole Albers
  • 8,715
  • 10
  • 73
  • 166
1
vote
2 answers

Implement custom 401 handling for a WebBrowser control

As per this article, I've extended the System.Windows.Forms.WebBrowser class to implement custom error-handling. Mostly, it works. The problem comes when the browser gets a "401 Unauthorized" response. That kind of response causes the WebBrowser…
Task
  • 3,668
  • 1
  • 21
  • 32
1
vote
1 answer

Clerk Auth - GET http://localhost:3000/ 401 (Unauthorized) - 401 Loop after Signin/Signout

Good day, I have been trying to setup Clerk on Next lastest version with the app the App router. I have went through the well written docs and it seem pretty straighforward to setup so I gave it a shot on a new project I have been working on. I have…
1
vote
0 answers

Getting 401 unauthorized error rapidapi How do i fix this?

I am currently using RapidAPI and encountering a 401 error. I have double-checked my API key and it seems to be correct, so I'm not sure what the issue might be. Can you please provide some guidance on how to resolve this issue? api.js import axios…
Jayesh Gadhok
  • 39
  • 1
  • 6
1
vote
0 answers

wso2 api manager Index 0 out of bounds for length 0 Error

I'm using from wso2 api manager 4.1.0, when I try it out a method without entering username and password from Devportal, I get the following error but I want to handle the error and show the client a 401 error. How can I do that?
Mr White
  • 97
  • 1
  • 9
1
vote
1 answer

HttpClient Unauthorized with Bearer Token

Due to the fact that HttpWebRequest is obsolete I'm in the process of upgrading to the equivalent in .NET 6. I'm not understanding why I'm getting a 401 unauthorized. I can get the bearer token successfully but I just can't seem to find the right…
1
vote
0 answers

Library: Java influxdb client. - influx HTTP status code: 401; Message: Unauthorized access

Java client library: finfluxdb client https://github.com/influxdata/influxdb-java Builder builder = InfluxDBClientOptions.builder(); builder.url(serverUrl); if (!token.isEmpty()) { builder.authenticateToken(token.toCharArray()); // 1. } else { …
1
vote
1 answer

How to handle FETCH_ERROR in RTK Query

I am requesting the server in localhost for some information using RTK Query. But when the server is not running it showing FETCH_ERROR. I want to handle this error. i.e when this happen i want to show a toast notification. But I can't catch this…
1
vote
1 answer

How to fix unauthorized error (401) after post method in Node.js?

I have a project for log in and sign up. Everything works on the local environment. After registering an account, it is sent to the database. If I try to register an account with the same information again, it is not possible because I receive a…
1
vote
1 answer

Keycloak replies 401 to Angular webapp

It's my first time trying to integrate KeyCloak. Here is what I've written in my Angular webapp app.module.ts file in order to initialize KeyCloak.js: import { HttpClient, HttpClientModule } from '@angular/common/http'; import { APP_INITIALIZER,…
Lucio Crusca
  • 1,277
  • 3
  • 15
  • 41
1
vote
1 answer

httpx POST request always gives "401 Unauthorized" before working fine the second attempt

I'm using async with httpx in a python script to make an HTTP POST request using DigestAuth. async with httpx.AsyncClient() as client: try: r = await client.post(f"http://{str(ip)}{setConfAddr}", auth=httpx.DigestAuth(username,…
1
vote
0 answers

Given token is not authorized, Need a python code to verify access into a sharepoint Folder

I developed the following python code below. On the other hand, in azure, I created a new app where I got the client Id and tenant ID and to later on, I gave the API permission (check picture): as well as the certificate and secrets by (check…
1
vote
0 answers

I'm getting an unauthorized error but my API key is working

I'm following a tutorial for a react weather app. I get the API from openweathermap (it works) and still i'm getting this error. Also I'm getting this (I don't know if it's related) SyntaxError: Unexpected token 'Y', "You need t"... is not valid…
Kali Fzz
  • 11
  • 2
1
vote
1 answer

WebPush.sendNotification Node.js giving 401 "header must be specified" error on googleapis endpoint

I'm getting the following error: WebPushError: Received unexpected response code at IncomingMessage. (/Users/sepp/.../node_modules/web-push/src/web-push-lib.js:347:20) at IncomingMessage.emit (node:events:406:35) at…
Seph Reed
  • 8,797
  • 11
  • 60
  • 125
1
vote
0 answers

Spring Security Database Role Authentication NOT Working and returning 401

I've been trying to create a spring security logic to authorize users (inserted into my database) to do different things based on their roles (simple). I'm supposed to have ROLE_USER and ROLE_ADMIN, but I don't think any of them work. Please help.…
victs
  • 11
  • 1