basic-authentication

Ruby rest-client file upload as multipart form data with basic authenticaion

跟風遠走 提交于 2019-12-03 12:12:59
问题 I understand how to make an http request using basic authentication with Ruby's rest-client response = RestClient::Request.new(:method => :get, :url => @base_url + path, :user => @sid, :password => @token).execute and how to post a file as multipart form data RestClient.post '/data', :myfile => File.new("/path/to/image.jpg", 'rb') but I can't seem to figure out how to combine the two in order to post a file to a server which requires basic authentication. Does anyone know what is the best way

How Do I Get By The Basic Authentication Handshake When Using Fiddler To Test A WCF REST Service?

北战南征 提交于 2019-12-03 11:31:48
问题 How Do I Get By The Basic Authentication Handshake When Using Fiddler To Test A WCF REST Service? 回答1: You need to base64 encode your username:password and then prefix it with Basic. It will end up looking something like: Authorization: Basic VEFWSVNcZGFycmVsOg== You then enter this in the request headers field. 来源: https://stackoverflow.com/questions/4947781/how-do-i-get-by-the-basic-authentication-handshake-when-using-fiddler-to-test-a

nginx and auth_basic

懵懂的女人 提交于 2019-12-03 11:17:35
问题 I am trying to get basic authentication working with nginx in Ubuntu Jaunty. In nginx.conf, I added these two lines under the server context: server { ... auth_basic "Restricted Access"; auth_basic_user_file /etc/nginx/.htpasswd; ... } Then I apt-get'ed apache2-utils to get htpasswd, which I used to create the htpasswd file: htpasswd -d -c /etc/nginx/.htpasswd joe When I try to access the site, the authentication dialog comes up as expected, but when I put in the username and password, it

How do I make an HTTP Post with HTTP Basic Authentication, using POCO?

好久不见. 提交于 2019-12-03 08:57:01
I'm trying to make an HTTP Post with HTTP Basic Authentication (cleartext username and password), using POCO. I found an example of a Get and have tried to modify it, but being a rookie I think I've mangled it beyond usefulness. Anyone know how to do this? Yes, I've already seen the other SO question on this: POCO C++ - NET SSL - how to POST HTTPS request , but I can't make sense of how it is trying to implement the username and password part. I also don't understand the use of "x-www-form-urlencoded". Is this required for a Post? I don't have a form. Just want to POST to the server with

Ajax: HTTP Basic Auth and authentication cookie

主宰稳场 提交于 2019-12-03 08:48:05
问题 I want to store the HTTP basic authentication headerline in an authentication cookie, so that I don't have to deal with the authorisation header in subsequent requests (I'm using jQuery): authenticate: function(auth) { var header = "Basic " + $.base64.encode(auth.username + ":" + auth.password); document.cookie = "Authorization: " + header; $.ajax({ type: "GET", url: "http://someurl", contentType: "application/json; charset=utf-8", dataType: "json", success: auth.success, error: auth.error })

Basic proxy authentication for HTTPS URLs returns HTTP/1.0 407 Proxy Authentication Required

删除回忆录丶 提交于 2019-12-03 08:42:34
问题 I want to use a proxy with basic authentication (username, password) for a connection (and only this connection) in Java. The following code works for HTTP URLs (e.g. "http://www.google.com"): URL url = new URL("http://www.google.com"); HttpURLConnection httpURLConnection = null; InetSocketAddress proxyLocation = new InetSocketAddress(proxyHost, proxyPort); Proxy proxy = new Proxy(Proxy.Type.HTTP, proxyLocation); httpURLConnection = (HttpURLConnection) url.openConnection(proxy); // Works for

Using ajaxSetup beforeSend for Basic Auth is breaking SignalR connection

北城以北 提交于 2019-12-03 07:31:24
I have a WebApi secured with Basic Auth which is applied to the entire Api using a AuthorizationFilterAttribute. I also have SignalR Hubs sitting on several of my Api Controllers. Alongside this I have a web page which makes use of my WebApi. The web page is mostly written in Backbone, so in order to make calls to my secured WebApi, I have added the following jquery $.ajaxSetup({ beforeSend: function (jqXHR, settings) { jqXHR.setRequestHeader('Authorization', 'Basic ' + Token); return true; } }); This works for communicating with my Api Controllers, but adding the above code has broken the

Why would my REST service .NET clients send every request without authentication headers and then retry it with authentication header?

孤街醉人 提交于 2019-12-03 07:03:16
问题 We happen to run a REST web service with API requiring that clients use Basic authentication. We crafted a set of neat samples in various languages showing how to interface with our service. Now I'm reviewing IIS logs of the service and see that the following pattern happens quite often: a request comes, gets rejected with HTTP code 401 the same request is resent and succeeds which looks like the first request is sent without Authorization headers and then the second one is sent with the

Accessing an Artifactory/Maven Repo that requires basic-auth

跟風遠走 提交于 2019-12-03 06:51:31
问题 I have an Artifactory repo that sits behind basic authentication. How would I configure the settings.xml to allow access? <mirrors> <mirror> <id>artifactory</id> <mirrorOf>*</mirrorOf> <url>https://myserver.example.com/artifactory/repo</url> <name>Artifactory</name> </mirror> </mirrors> <servers> <!-- This server configuration gives your personal username/password for artifactory. Note that the server id must match that given in the mirrors section. --> <server> <id>Artifactory</id> <username

How to use Basic Authentication with JIRA REST API in JavaScript?

蹲街弑〆低调 提交于 2019-12-03 06:44:35
I'm creating a JavaScript app for a Smart TV to show dashboards on the tv. I get the list of dashboards with the JIRA REST API. The url I use for this is: jira/rest/api/2/dashboard?startAt=&maxResults= afterwards I create a wallboard as followed to show them on the tv: jira/plugins/servlet/Wallboard/?dashboardId=&os_username=&os_password= because of the os_username and os_password , JIRA knows i'm authenticated and gets the right list. this list is the one i need from the beginning but because i call the url above with the parameters os_username and os_password it does get the right list but