http-status-code-401

iPhone: why i got this error — HTTP error 401— Twitter

自闭症网瘾萝莉.ら 提交于 2019-12-06 03:31:28
问题 hi i am developing Twitter client on iPhone, here i am using MGTwitter library and OAuthentication, i am Authenticating(sign in) and Getting Request Token, My problem is, when i send request i am getting error Request 8DC1F854-0F16-40BF-85EC-669AF0B25FCE failed with error: Error Domain=HTTP Code=401 "The operation couldn’t be completed. (HTTP error 401.)" how i have to solve this error Please tell me Thank you 回答1: Probably twitter is just down and your code is fine. 回答2: What worked for me:

When using an API route, return Http Response 401 instead of redirect to login page when not authorised

眉间皱痕 提交于 2019-12-06 00:28:51
I'm building an ASP.NET Core 2.0 website using MVC and WebAPI to provide access to a series of microservices. Where a WebAPI controller requires a user to be authenticated and authorised (using the Authorize attribute), any unauthorised or not-logged in user gets the response back as the entire HTML for the MVC login page. When unauthorised users access the API, I would like to return the HTTP status code 401 and its associated error message in the response, instead of an entire HTML page. I've looked at a few existing questions and noticed that they either refer to ASP.NET MVC (such as

handle 401 unauthorized error on windows Phone with Phonegap

本秂侑毒 提交于 2019-12-06 00:11:27
I'm creating an application with phonegap on windows phone 7, that need an authentification on a server. When we log with the correct username and password, we got a 200 status. And everything works. But if we make a mistake on the login or the password, the server send us back a 401 error. This freeze my application. I need to kill it and restart it. So not very practice. I check the response with fiddler on my computer and the phone receive the 401 error, and I manage this error on my code. this works on my other platform (android and ios). So I would like to know how I can manage this error

The remote server returned an error: (401) Unauthorized. Using CSOM in ASP.NET

為{幸葍}努か 提交于 2019-12-05 23:29:20
问题 I'm tried to pull some SharePoint 2013 list data I created which works fine when running locally on my machine and when run locally one the server. I'm user the same credentials when running both locally and locally on the server. The issue is when I publish and navigate to my ASP.NET app on the server I get the "The remote server returned an error: (401) Unauthorized." Error... I've looked at a bunch of the posts on stackoverflow and some other articles on the web This points out that the

MVC + Ajax call to Controller Loses Authentication

岁酱吖の 提交于 2019-12-05 20:08:41
I've seen similar issues in some posts but none of the answers have helped yet. My MVC app has a few AJAX/JSON response methods in one controller, and the calls get to destination but it doesn't work in IE or Chrome, and in mozilla it does, but Firebug returns a very strange set of 3 attempts (all return 401 error) but the last one does actually work! My App has windows authentication, how can I extend this to my Ajax methods? the rest of the app works fine. I've tried bypassing the 401 by returning 200 Status from Global.asax (Application_EndRequest) but continues to do the same. Basically

ASP.NET MVC 3 Intranet site on IIS7.5 w Windows Authentication gives 401.3 and File authorization failed for the request when trying to log in

左心房为你撑大大i 提交于 2019-12-05 18:38:49
问题 I have made an ASP.NET MVC 3 Intranet site with Windows Authentication enabled: in the Visual Studio project file properties in the web.config, i.e. <authentication mode="Windows"/> on the site properties in the IIS 7.5. server Anonymous access is disabled for all these three above, the web.config says <deny users="?"/> . Impersonation is disabled in the web.config by identity <impersonate="false"/> and on the site properties in the IIS 7.5 server. And finally, the NETWORK SERVICE is set to

passport.js - Access fail message after 401 error

你离开我真会死。 提交于 2019-12-05 16:13:57
Currently I can access messages set in done(null, user, {message: 'ok'}) inside post request via req.authInfo like this: app.post('/reg', passport.authenticate('local-reg', { session: false }), function (req, res) { console.log(req.authInfo.message); --> 'ok' }); Which is very useful. But how can i access message like this done(null, false, {message: 'username taken'}) in the same fashion, as it seems that passing done(null, false) in passport.authenticate makes it throw 401 unathorised, therefore not forwarding to the route handler itself. Maybe i misunderstood something? P.S.: I'm posting

PHP Digest auth, logout

限于喜欢 提交于 2019-12-05 08:57:51
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(){ $realm = "Restricted area"; $users = array("jamesm"=>""); if (empty($_SERVER["PHP_AUTH_DIGEST"])) { header("HTTP/1.1 401 Unauthorized"); header("WWW-Authenticate: Digest realm=\"{$realm}\",qop=\"auth\",nonce=\"".uniqid()."\",opaque=\"".md5($realm)."\""); return false; } if (!($data = http_digest_parse($_SERVER["PHP_AUTH_DIGEST"])) || !isset($users[$data["username

The request failed with HTTP status 401: Unauthorized

大兔子大兔子 提交于 2019-12-04 23:38:38
I have a .NET 2.0 website (VB) running in my IIS6 (XP Pro SP2) and a .NET 3.5 (configured as .NET2 under IIS's ASP.NET tab, of course) hosting an ASMX web service. In Chrome, I can call the ASMX and invoke the web methods successfully. However, in calling the web methods in code, from the .NET 2.0 website I get: The request failed with HTTP status 401: Unauthorized. How do I get around this? btlog You need to set the credentials in you application when you initialise the webService object. Something like webService.UseDefaultCredentials = true This will set the credentials of the request to

Catch 401 error in Rails with Devise when user has multiple windows open

情到浓时终转凉″ 提交于 2019-12-04 21:41:36
Scenario is this: User has 2 windows on which s/he is logged in. S/he logs out of one, stays logged in on the other, and then on the latter, triggers some action, say a form submission. Initially, what happened is that it threw a invalid authenticity token error. I've updated the protect_from_forgery in ApplicationController to be with: :null_session so that instead of the Exception it throws a 401. Great! Now for step 2, rather than the user just seeing a line of text saying You need to sign in or sign up before continuing. , I'd like to redirect him/her back to the sign in page. This is