http-status-code-401

HttpWebRequest 401 with NTLM Authenticiation

瘦欲@ 提交于 2019-12-23 23:06:29
问题 I am having difficulties authenticating a HttpWebRequest to a webserver. The response I am receiving is simply a 401. I've made sure I set the credentials correctly on the C# side, and IIS is correctly set to allow NTLM authentication. I don't know if this matters, but he computer is not on the same domain as the the web server. I am sure the user/pass is correct but are there any other authorization settings needed to configure on the user? If I enable Basic authentication, and disable

Include custom content in ASP.NET Windows Authentication 401 response

半世苍凉 提交于 2019-12-23 05:33:09
问题 We have an internal system where users can authenticate using Windows authentication but we want to include some custom content in the 401 repsonse that takes the user to a custom username/password authentication page if the cancel off the Windows authentication dialog. When an unauthenticated user accesses a page, Windows authentication responds with a 401 Unauthorized response, with the headers WWW-Authenticate: Negotiate WWW-Authenticate: NTLM This prompts the browser to show a dialog

WebDAV return 401 - How to authenticate?

给你一囗甜甜゛ 提交于 2019-12-23 05:23:17
问题 I have a problem with WebDAV. I have to get a list of files. I have this request: <?xml version="1.0"?> <D:searchrequest xmlns:D = "DAV:"> <D:sql> SELECT "DAV:displayname" FROM "address" WHERE "DAV:ishidden" = false AND "DAV:isfolder" = false </D:sql> </D:searchrequest> Response: 401 - Unauthorized: Access is denied due to invalid credentials. I have user and password (who has access), but I don't know, how I can put this data to XML request. 回答1: WebDAV uses an HTTP authentication. So you

Implement clientside token-based authentication using plain Javascript/AJAX

偶尔善良 提交于 2019-12-23 04:39:45
问题 Can anyone point me to an article that explains clientside token auth implementation using Javascript? I found many articles on Angular but that is not what I'm looking for. That brings me to the question if it is possible to be done with Javascript. Also how to handle scenarios when the auth server throws a 401. Is there a built in exception to detect that response? Or is a custom exception required to be implemented? 回答1: I have personally used JSON web tokens in one of my projects. http:/

Angular5 http reponse interceptor unable to read status code

岁酱吖の 提交于 2019-12-23 03:01:44
问题 I am trying to intercept http responses and redirect any 401's but the err object below is only returning me the following string. I was expecting to at least find the status code.. 401 - Unauthorized Details: Http failure response for http://localhost:4200/api/foo: 401 Unauthorized I can see in the network tab that a well formed 401 is being returned by the server. Any ideas on how I can read them correctly? intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>

Angular5 http reponse interceptor unable to read status code

早过忘川 提交于 2019-12-23 03:01:24
问题 I am trying to intercept http responses and redirect any 401's but the err object below is only returning me the following string. I was expecting to at least find the status code.. 401 - Unauthorized Details: Http failure response for http://localhost:4200/api/foo: 401 Unauthorized I can see in the network tab that a well formed 401 is being returned by the server. Any ideas on how I can read them correctly? intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>

Why my httpwebrequest post to myhandler.ashx is rejected with status code 401

前提是你 提交于 2019-12-23 02:38:28
问题 I've already written an HTTPHandler that gets POSTed from a ColdFusion page and it works successfully; now, I am trying to write a web application in ASP.NET so I can post a form to the .ashx handler from an .aspx page. Application Trace (trace.axd) shows the following as my last 3 entries: 2 8/14/2009 1:53:56 PM /Default.aspx 200 GET View Details 3 8/14/2009 1:54:04 PM /Default.aspx 200 POST View Details 4 8/14/2009 1:54:13 PM /UploadHandler.ashx 401 POST View Details I have a breakpoint in

.NET core returning 500 instead of 401 when missing cookie

纵然是瞬间 提交于 2019-12-23 01:39:06
问题 I have a .NET core API that uses cookie authentication. It is accessed by a PWA/SPA that has its own login route. In Startup.cs : public void ConfigureServices(IServiceCollection services) { ... services.AddIdentity<MyUser, MyRole>(options => { ... // Use cookie authentication var expiresIn = new TimeSpan(1, 0, 0); // 1 hour timeout var c = options.Cookies.ApplicationCookie; c.AuthenticationScheme = "appSchemeName"; c.CookieName = "appCookieName"; c.AutomaticAuthenticate = true; // If this is

How do I connect to router “panel” using C#

我们两清 提交于 2019-12-22 12:45:10
问题 I'm trying to connect to my router "panel" (192.168.1.1) using a simple C# HTTP Web Request: var userName = "admin"; var passWord = "admin"; var encoding = new ASCIIEncoding(); var postData = "" + userName; postData += (":" + passWord); //I saw (using Wireshark) that the HTTP packet is sending the username & password in this form: "username:password" byte[] data = encoding.GetBytes(postData); var myRequest = (HttpWebRequest)WebRequest.Create("http://192.168.1.1"); myRequest.Method = "POST"; *

handle 401 unauthorized error on windows Phone with Phonegap

ⅰ亾dé卋堺 提交于 2019-12-22 10:37:54
问题 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.