http-status-code-401

Angular.js 401 Unauthorized Status Code

旧城冷巷雨未停 提交于 2019-12-11 21:09:50
问题 I want to get access token for authentication. My post result like POST https://staj-io-goldenilkay92-1.c9.io/api/v1/oauth/token 401 (Unauthorized) but when I try to post with postman it works. Server Side Headers res.setHeader('Access-Control-Allow-Origin', '*'); res.setHeader('Access-Control-Allow-Methods', 'POST, GET, PUT, DELETE, OPTIONS'); res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type, Authorization'); res.setHeader('Access-Control-Allow-Credentials', 'true

Get Response header when 401 occurred

点点圈 提交于 2019-12-11 19:40:03
问题 Hi I am working on android and java.So my problem is that whenever 401 occurred I am not able to get response header and also not able to get status code. I am using http url connection. My code looks like this: String https_url = "http://abc.com"; HttpsURLConnection con = null; int status; URL url; try { url = new URL(https_url); con = (HttpsURLConnection)url.openConnection(); con.setDoInput(true); int responseCode = con.getResponseCode(); //throw IOException:Received authentication

Redirect 401 “authorization required page” to custom page

主宰稳场 提交于 2019-12-11 18:52:32
问题 Is there a simple way I can encode a front-end php redirect to a custom page upon error? I have a page in a directory protected by an .htaccess password, but if you cancel the system dialog or enter the wrong details, you get a plain html message in the browser and have to navigate back. Would be great to have custom error pages as a solution to this. Thanks! 回答1: In the .htaccess file, just add ErrorDocument 401 /401.html And change 401.html to the name of the file you want to display. 来源:

Client calling multiple asmx services

主宰稳场 提交于 2019-12-11 13:19:00
问题 I have a WPF client application which calls multiple ASMX webservices I keep on getting 401 authentication errors. Sometimes for whatever reason one succeeds whereas the other one fails but then for some reason one works then the other one fails...Have no idea what the reason is. One of the service needs to do a double hop and it was working earlier during the day and for some reason now has stopped working I do not believe I changed anything. I Followed http://social.technet.microsoft.com

SPARQLWrapper HTTP Error 401: Unauthorized

旧巷老猫 提交于 2019-12-11 09:44:14
问题 I secured my SPARQL endpoint via SQL Accounts according to VirtSPARQLProtectSQLDigestAuthentication. Before this operation, I can get the data through the code: from SPARQLWrapper import SPARQLWrapper, JSON, DIGEST sparql = SPARQLWrapper("http://example.org/sparql") sparql.setQuery("...") sparql.setReturnFormat(JSON) results = sparql.query().convert() And after that, I use the DIGEST way to get the data, from SPARQLWrapper import SPARQLWrapper, JSON, DIGEST sparql = SPARQLWrapper("http:/

IE 7 not showing my custom 401 page

最后都变了- 提交于 2019-12-11 06:01:15
问题 I created a 401 page, which is html, and within an accessible directory. It displays in IE 6, Firefox, Safari, but not IE 7. Here is the .htaccess file for setting the authentication on the directory and location for the 401 page. KrbServiceName HTTP KrbMethodNegotiate On KrbMethodK5Passwd On #KrbVerifyKDC on KrbSaveCredentials off KrbAuthRealms HCCC.CAMPUS Krb5KeyTab /etc/httpd/keytab KrbAuthoritative off AuthType Kerberos AuthName "Please Login" AuthBasicProvider ldap AuthzLDAPAuthoritative

Mvc action returns 401 error

僤鯓⒐⒋嵵緔 提交于 2019-12-11 04:49:27
问题 This is a strange one. They always are when I get to this point. I have an MVC app. It's a single page app so all routes are ajax calls but I don't think this is relevant. Strangely and all of a sudden one particular page has started giving me a 401 and prompting for creds. Actually it's both pages that are in this MVC Area. It is only doing it in qa no locally so I can't debug. And It only started after last push. None of the other pages are doing this. So I compared the headers via fiddler

asp.net 4.0 Custom 401.2 not Authorized custom page

本小妞迷上赌 提交于 2019-12-10 21:43:59
问题 I successfully implemented role based authorization in ASP.NET. When a person does not have the needed role he gets to see an error page for 401.2 not authorized. What I would like to accomplish now is to have a custom 401 page in my application and have it redirected there via settings in the web.config. I tried this: <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"><error statusCode="401" redirect="NoAccess.htm" /></customErrors> But this does not get caught. Do I have

Send BASIC auth by default, rather than wait for HTTP 401

痴心易碎 提交于 2019-12-10 15:36:10
问题 I have a web service that requires a BASIC authentication header to be present in the request, or the service will return an HTTP 401 (unauthorized). This works - when the challenge comes back, the browser (in this case, Chrome) pops up and asks for the credentials. They are then saved for future requests. My problem is that now two requests are being made on each subsequent request to the service - one without auth (which receives a 401), and then the browser immediately replies with the

IIS asks for login credentials only on a specific folder

…衆ロ難τιáo~ 提交于 2019-12-10 13:29:40
问题 i have on IIS 7 a site which has several sub folders. the site was built using .net 2 and is running in a pool in integrated mode. the whole site works perfectly except for all aspx files under a folder called "Reports". when the user is trying to access any aspx page under that folder (i.e. http://domain/Reports/page1.aspx) he gets a 401 response and the browser prompts for a user and password. this happens when accessing the site remotely and locally. when trying to look on the IIS log