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

Why do I get a 401 error after a 301 redirect?

I get 401 Unauthorized when I do a 301 redirect from an AWS Lambda to the top page of my site hosted through AWS Amplify. I also get the error Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at ... (Reason:…
1
vote
1 answer

Getting 401 Unauthorized Error When Attempting to Bulk Export CSV from Crunchbase Despite Authorized API Key

I'm trying to get bulk CSV export from Crunchbase. According to the documentation (https://data.crunchbase.com/docs/daily-csv-export) you need to paste your API key in this…
Mateusz Dorobek
  • 702
  • 1
  • 6
  • 22
1
vote
1 answer

why I get an 401 error when i upload a file to video indexer

I've created a logic app that uploads a video file from OneDrive to VideoIndexer for processing. Im getting an 401 error. { "ErrorType": "USER_NOT_ALLOWED", "Message": "Access token does not have 'Contributor' permission. Trace id:…
1
vote
1 answer

Default 401 instead of redirecting for OAuth2 login Spring Security

I support two types of authentication and need to return 401 for most paths instead of redirects. For Keycloak I used the HttpUnauthorizedEntryPoint below and its fine, but for the OAuth2 login, it prevents the automatic redirect (on…
1
vote
1 answer

c# .NET 6.0 API using Azure AD token (called from Blazor server side) returns 401 unautorized

I have a Blazor server application that uses Azure AD login. This works fine, but when setting [Authorize] on my API controller, the controller returns 401 unauthorized event though the Bearer token is passed. I can see the token being passed in the…
1
vote
1 answer

how to cancel http request if token is expired using interceptor in angular

I have a scenario where I dont want to get 401 unauthorized response when token is expired. So I planned implement it using interceptor, to check token expiry and if token expired I will redirect to login page and want to cancel the API call. I get…
1
vote
1 answer

Displaying Comment Form in Django 401 Error

I am trying to build a CRM in Django and in doing so I am trying to add a place to add comments to a lead. I created a form and upon submitting a comment I get directed to the 401 page where I am greeted with an error. On the 401 page it references…
1
vote
1 answer

HttpClient 401 Unauthorized - How to authenticate IIS website to another IIS website

I have this well known 401 Unauthorized error. My scenario is that website A needs to call HTTP request (GET) to website B. Both websites runs on the same IIS server under different application pools (accounts). When I call HTTP request within the…
Muflix
  • 6,192
  • 17
  • 77
  • 153
1
vote
1 answer

How to create right request to Riot API

So I've been trying valorantpy module that provides an easy way to send requests to get personal player statistics. This code: import os import valorant KEY = 'key' client = valorant.Client(KEY, locale="ru-RU", region="eu", route="europe") account…
Razy
  • 11
  • 1
1
vote
0 answers

HttpClient azure function returning 401 error

I have a python azure function I'm trying to integrate with a C# backend. I'm trying to upload a file from an angular front end using a c# back end to post the data. However, I'm getting a 401 error unauthorized. My function isnt anonymous level…
1
vote
1 answer

*401 Unauthorized* When following tutorial Java implementation of Video.insert by developers.google.com

I am trying to upload an mp4 file to my youtube channel using the YouTube Data API, however, I keep getting a 401 Unauthorized back. Using the google console cloud I created an (unrestricted) API key. Afterwards, I enabled YouTube Data API v3 I then…
1
vote
1 answer

I can not understand the working process of jwt and the 401 and 403 error and the work of refresh token

Recently I am learning jwt but I can not understand the actual work of jwt and 401 and 403 errors. It will be helpful for me if someone gives me a clear understanding of it. Thanks.
1
vote
0 answers

What is the correct way to handle UnAuthenticated response (401) in Android retrofit

I want to take the user to the login screen whenever I encounter a 401 response from the server. I am currently handling 401 like this: public abstract class BaseCallback implements Callback { private final Context context; public…
hushed_voice
  • 3,161
  • 3
  • 34
  • 66
1
vote
1 answer

axios not returning the status of called api if error in reactjs

I am using axios to make apis calls in react. If there is no token provided or token got expired server sends the 401 status. I want to check that status on reactjs side. But if i check err object in catch the status field is null. Here is the…
Sunil Garg
  • 14,608
  • 25
  • 132
  • 189
1
vote
1 answer

How to pass NTLM credentials using angular http post call?

I am working on localhost where angular and web api using 2 different ports that's causing issue now. I am trying to call web api c# from angular like…