Web Api won't download file using jQuery Ajax and Basic Auth

徘徊边缘 提交于 2020-01-29 05:37:04
问题 I am using the ASP.NET Web API to build a prototype of a web service (and site) which has a method to download a file. When the user on the front-end presses the export button a jQuery ajax GET request is made and received by the controller which on it's turn calls the method named Excel (shown below). The method runs without any problem and finishes. When I look in Chrome at the header (see!77093) it receives the response with (as far as

Basic auth in DNN Web API service

拥有回忆 提交于 2020-01-25 08:25:06
问题 I'm building a library type module for DNN that will house a Web API service that is meant to be called by a separate application. It has one controller that inherits from DnnApiController. I'd like the requests in this service to use basic auth, since the other app has no association with DNN and its users won't be interacting with the portal. All it can do is pass in a username and password (this will happen over SSL). We are running DNN 7.3 which is configured to use standard Forms

Proxy built with netcat not allowing http basic authentication

◇◆丶佛笑我妖孽 提交于 2020-01-25 06:38:16
问题 I made a simple proxy server using nc , here's the one-liner: mkfifo queueueue nc -l 8080 <queueueue | nc http://$JENKINS_HOSTNAME 80 >queueueue It listens on port 8080 and then forwards the data to a connection to our Jenkins server. Jenkins is behind a VPN, and the machine I am running this proxy on has VPN access. On my other machine (no VPN access), I would like to curl the Jenkins server, here's the command to initiate the request through the proxy: http_proxy= curl --user

CakePHP form authentication for normal requests with basic authentication for JSON

心已入冬 提交于 2020-01-24 12:33:08
问题 I'm attempting to to build a web application that can be view by a user in a browser but also has an API for developers to interface with my application. My question is how do I change the authentication based on what type of request it is in CakePHP? I would like my application to prompt users using the site with form authentication but when a request comes in with a '.json' to use basic authentication. I've tried this in my AppController: class AppController extends Controller { public

Call web api with basic authentication always get 401 unauthorized from IIS

喜夏-厌秋 提交于 2020-01-24 05:44:12
问题 Tonight i come search some help about how to call a web api hosted in IIS. Everything work well in local from visual studio to iis express. But strangely, after publish on my IIS server. I always get 401 unauthorized :'( Here is the code i use and the settings from my IIS server. I will be very grateful if somebody can help me. Thank you ** The controller and the function i try to call (with basic authentication attribute) ** [HttpGet] [ActionName("Get_UserID")] [IdentityBasicAuthentication]

Cannot integrate Spring Security BASIC Authentication into Jersey/JAX-RS and Tomcat

假如想象 提交于 2020-01-24 05:24:14
问题 I am attempting to add BASIC authentication to a RESTful web service that I have created using Jersey/JAX-RS and Tomcat Apache 7.0. In the future I want to deploy this web service on WebSphere so I have chosen to use Spring Security (ver 2.5.6) for my project. My problem is this: though I believe my various xml files are correct and I have added spring.jar to my classpath I am getting the following error when starting the server. SEVERE: Error configuring application listener of class org

How do I set the WWW-Authentication header in an IAuthenticationFilter implementation?

社会主义新天地 提交于 2020-01-24 04:11:25
问题 I'm implementing basic authentication using MVC5's IAuthenticationFilter interface. My understanding is that this is now the preferred approach instead of using a DelegatingHandler. I've got it working but the www-authenticate header is not being returned in the response. This is my implementation of ChallengeAsync: public async Task ChallengeAsync(HttpAuthenticationChallengeContext context, CancellationToken cancellationToken) { var result = await context.Result.ExecuteAsync

Escaping username characters in basic auth URLs

人盡茶涼 提交于 2020-01-18 21:33:04
问题 When using http basic authentication, the username can be passed in the URL, e.g. But now suppose the username is an email address, e.g. Doing this is clearly ambiguous: Is there a way to escape the @ character in the username? I tried standard URL encoding: But that didn't do it. 回答1: According to RFC 3986, section 3.2.1, it needs to be percent encoded: userinfo = *(

Possible to Send Basic Auth in Link in Java

拈花ヽ惹草 提交于 2020-01-17 04:07:27
问题 Is it possible to send basic auth credentials in a link? I have tried but it's not working (in chrome on a mac, it keeps telling me to provide APIKey, which is password in this case). I need to be able to have a user click on a link and provide these credentials, if possible. The link is to sometimes huge files (< 1 gig). So instead of me, downloading the file in question I would like to just construct a link that points to it, and have the user download it.

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,