http-status-code-401

Twitter API status update not working when updating to v1.1

戏子无情 提交于 2020-03-25 17:52:59
问题 I have a twitter application which sends tweets automatically for uses of our blog application whenever they post a new blog item. This application is now returning an error HTTP/1.1 401 Unauthorized Content-Type: application/json; charset=utf-8 Date: Mon, 12 Nov 2012 22:05:27 UTC Server: tfe {"errors":[{"message":"Could not authenticate you","code":32}]} My coldfusion code is as follows for posting the tweet: <cfset var tweetURL = "https://api.twitter.com/1.1/statuses/update.json"> <cfhttp

401 Unauthorized with OData Update and Delete

我是研究僧i 提交于 2020-01-16 19:24:25
问题 For the first time I have stumbled upon a problem where the solution has not already been provided (completely) on SO, but I hope someone out there can help. My problem is similar to PUT and DELETE in RESTful WCF Service cause 401 Unauthorized error . That is, I have a WCF Data Service where I get a 401 whenever I try to do updates or deletes (read and post works without any problems). The difference to the abovementioned post is that I am not hosting my service in IIS but on Windows Azure,

IE, FireFox, Opera, and Safari don't display BASIC auth prompt on successive 401 responses from server

二次信任 提交于 2020-01-16 04:55:05
问题 SCENARIO: I have a java web app running in the latest Tomcat 6. I also have a single servlet filter that provides authentication. I support BASIC auth and it appears to work fine - most of the time. The first time a browser [pick any one - IE, FireFox, Opera, Safari, Chrome] hits one of our protected URL(s), it displays the standard browser-specific login prompt. IFF you enter the proper username/password - everything is fine, a new session is created, and everything operates normally. IF,

Return 401 from WCF service

耗尽温柔 提交于 2020-01-13 02:28:48
问题 How can I return a HTTP 401 from a WCF service? 回答1: If you are programming a REST-service it can be done this way: private IWebOperationContext context = new WebOperationContextWrapper(WebOperationContext.Current); // Get the context context.OutgoingResponse.StatusCode = HttpStatusCode.Unauthorized; // Set the 401 回答2: throw new WebFaultException(System.Net.HttpStatusCode.Unauthorized); Notes: "MSDN: When using a WCF REST endpoint (WebHttpBinding and WebHttpBehavior or

Handling Authentication in Okhttp

本秂侑毒 提交于 2020-01-12 01:58:33
问题 I'm using OkHttp 2.3 with basic authentication requests, according to OKHttp docs, it automatically retries unauthenticated requests, but whenever I provide invalid credentials, the request takes too much time and I get this exception in the end: java.net.ProtocolException: Too many follow-up requests: 21 How can I prevent OkHttp from automatically retrying unauthenticated requests, and return 401 Unauthorized instead? 回答1: protected Authenticator getBasicAuth(final String username, final

Jquery $.Ajax() keep getting 401 response

痴心易碎 提交于 2020-01-07 08:22:32
问题 I'm trying to get JSON through an API but it keeps giving me Response for preflight has invalid HTTP status code 401 This is my code $.ajax({ beforeSend: function (request) { request.withCredentials = true; request.setRequestHeader("Authorization", "Basic" + btoa("usernamehere:keyhere")); }, crossDomain: true, contentType: 'application/json', url: url, With the username and key different ofcourse. I've tried without btoa, i've tried using headers: and I've edited the CORS. But nothing works,

Unauthorized request, 401, using Spring if I open a modal or I send an ajax request

有些话、适合烂在心里 提交于 2020-01-05 04:07:19
问题 I have a problem with Keycloak and Spring Boot .. I developed a web-app with some modal and ajax request, sometimes, and I don't know why, I receive status 401 if I click on an href to open a modal, or if I submit a form via ajax... I don't see any error log server-side, but I checked the request and I have WWW-Authenticate: Bearer realm="Unknown" . I think it is weird. This is the entire request: 1. Request URL: MyUrl 2. Request Method: GET 3. Status Code: 401 Unauthorized 4. Remote Address:

Unauthorized request, 401, using Spring if I open a modal or I send an ajax request

做~自己de王妃 提交于 2020-01-05 04:07:12
问题 I have a problem with Keycloak and Spring Boot .. I developed a web-app with some modal and ajax request, sometimes, and I don't know why, I receive status 401 if I click on an href to open a modal, or if I submit a form via ajax... I don't see any error log server-side, but I checked the request and I have WWW-Authenticate: Bearer realm="Unknown" . I think it is weird. This is the entire request: 1. Request URL: MyUrl 2. Request Method: GET 3. Status Code: 401 Unauthorized 4. Remote Address:

ASP.NET MVC 5 [Authorize] attribute is generating login pop-up in browser instead of redirecting to 302 login page

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-05 00:57:45
问题 I've never seen this happen before: I've decorated a controller with an [Authorize (Roles = "Admin"] attribute, but instead of sending unregistered/un-signed users to the Login View via 302 redirect, a javascript-generated sign-in prompt appears in the Chrome browser: After entering in his or her credentials, the user is then given a 401 error. The suggestions on SO for setting the <authentication mode> and removing the <FormsAuthenticationModule> in Web.Config don't alter this behavior. I

401 Unauthorized when custom IHttpHandler tries to read from virtual directory

ぐ巨炮叔叔 提交于 2020-01-04 11:04:03
问题 I have a custom IHttpHandler, specified in web.config as follows: <httpHandlers> <add verb="*" path="*.html" validate="true" type="PipingRedirectHandler" /> <add verb="*" path="*.htm" validate="true" type="PipingRedirectHandler" /> </httpHandlers> In IIS 7 (on Win 2008 R22) I added handler mappings with Path: *.html/*.htm and executable: %windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll . I also have a virtual directory mapped to a windows share on another machine, Alias: