digest-authentication

Asterisk Digest Authentication for SIP INVITE gives “user mismatch” error

有些话、适合烂在心里 提交于 2019-12-03 18:14:00
问题 I am building a basic SIP UA. I am sending the following INVITE, as seen in Asterisk console (only headers relevant to authentication are shown): INVITE sip:104@192.168.1.92 SIP/2.0 From: "110"<sip:110@192.168.1.92>;tag=80859256 To: <sip:104@192.168.1.92> Call-ID: 80859256 CSeq: 80859256 INVITE Via: SIP/2.0/UDP 192.168.1.92:6000;branch=z9hG4bK-80859256 Contact: <sip:110@192.168.1.92> In response, I get the following challenge: SIP/2.0 401 Unauthorized Via: SIP/2.0/UDP 192.168.1.92:6000;branch

Apache HttpClient 4.x behaving strange when uploading larger files?

十年热恋 提交于 2019-12-03 16:26:41
I'm developing and testing a little straight-forward client-server application using java (and scala). The server is based on com.sun.net.httpserver.HttpServer and allows the upload of files via a basic RESTful interface using POST and PUT operations. The upload operation is restricted using Digest authentication which we implemented by ourselves, is tested and works in browsers, curl and Apache HttpClient . The upload client wraps Apache HttpClient 4.1.2 and executes PUT operations over http to upload file entities. The content-type of the file is specified as application/xml in the header

Digest auth with Java & Apache client : Always 401 Unauthorized

梦想的初衷 提交于 2019-12-03 08:31:58
I'm trying to implement digest auth with an HTTP client, but this does not work at the moment. Can someone check if this code is correct? For testing purpose I use http://httpbin.org/ , but all I get is HTTP/1.1 401 Unauthorized . Here is the example code: private static void doDigestAuth() throws ClientProtocolException, IOException, AuthenticationException, MalformedChallengeException { HttpHost target = new HttpHost("httpbin.org", 80, "http"); CredentialsProvider credsProvider = new BasicCredentialsProvider(); credsProvider.setCredentials(new AuthScope(target.getHostName(), target.getPort()

Consuming a web service using digest authentication

北城以北 提交于 2019-12-02 21:35:00
问题 We are using C# to send XML data via SOAP. The service requires HttpDigest authentication with #PasswordDigest and #Base64Binary Nonce . Our binding code: protected BasicHttpBinding binding = new BasicHttpBinding() { Name = "ShipmentServiceSoapBinding", CloseTimeout = new TimeSpan(0, 01, 0), OpenTimeout = new TimeSpan(0, 01, 0), ReceiveTimeout = new TimeSpan(0, 10, 0), SendTimeout = new TimeSpan(0, 5, 0), AllowCookies = false, BypassProxyOnLocal = false, HostNameComparisonMode =

Consuming a web service using digest authentication

六月ゝ 毕业季﹏ 提交于 2019-12-02 12:20:06
We are using C# to send XML data via SOAP. The service requires HttpDigest authentication with #PasswordDigest and #Base64Binary Nonce . Our binding code: protected BasicHttpBinding binding = new BasicHttpBinding() { Name = "ShipmentServiceSoapBinding", CloseTimeout = new TimeSpan(0, 01, 0), OpenTimeout = new TimeSpan(0, 01, 0), ReceiveTimeout = new TimeSpan(0, 10, 0), SendTimeout = new TimeSpan(0, 5, 0), AllowCookies = false, BypassProxyOnLocal = false, HostNameComparisonMode = HostNameComparisonMode.StrongWildcard, MaxBufferPoolSize = 5242880, MaxReceivedMessageSize = 655360, MessageEncoding

Problems with digest authentication with http.client in Node.js

梦想与她 提交于 2019-12-01 08:06:03
问题 I try to implement digest request when using http.get and get " Digest authentication failed " message every time :( var hashlib = require('hashlib'), http = require('http'), url = require('url'), qs = require('querystring'), hashlib = require('hashlib'); var username = 'user'; var password = 'pass'; var options = { 'host' : 'username.livejournal.com', 'path' : '/data/rss?auth=digest' }; http.get(options, function(res) { res.setEncoding('utf-8'); // got 401, okay res.on('data', function(chunk

Need help creating Digest authentication for Android

落爺英雄遲暮 提交于 2019-11-30 14:23:37
问题 I have this code so far: private class DownloadWebPageTask extends AsyncTask<String, Void, String> { @Override protected String doInBackground(String... theParams) { String myUrl = theParams[0]; String myEmail = theParams[1]; String myPassword = theParams[2]; HttpPost post = new HttpPost(myUrl); post.addHeader("Authorization","Basic "+ Base64.encodeToString((myEmail+":"+myPassword).getBytes(), 0 )); ResponseHandler<String> responseHandler = new BasicResponseHandler(); String response = null;

Need help creating Digest authentication for Android

ε祈祈猫儿з 提交于 2019-11-30 10:47:37
I have this code so far: private class DownloadWebPageTask extends AsyncTask<String, Void, String> { @Override protected String doInBackground(String... theParams) { String myUrl = theParams[0]; String myEmail = theParams[1]; String myPassword = theParams[2]; HttpPost post = new HttpPost(myUrl); post.addHeader("Authorization","Basic "+ Base64.encodeToString((myEmail+":"+myPassword).getBytes(), 0 )); ResponseHandler<String> responseHandler = new BasicResponseHandler(); String response = null; try { response = client.execute(post, responseHandler); InputStream content = execute.getEntity()

Curl request with digest auth in PHP for download Bitbucket private repository

自闭症网瘾萝莉.ら 提交于 2019-11-30 08:43:22
I'm try to do this request on php, for download the last source from my Bitbucket private repository: curl --digest --user user:pass https://bitbucket.org/user/repo/get/tip.zip -o test.zip in command line its ok, the file download perfect, but in php dont work, this my php code: $out = fopen('test.zip', 'w+'); $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_VERBOSE, true); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); curl_setopt($ch, CURLOPT_USERPWD, 'user:pass'); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_SSL

How to pass proxy-authentication (requires digest auth) by using python requests module

我是研究僧i 提交于 2019-11-29 23:11:19
I was using Mechanize module a while ago, and now try to use Requests module. ( Python mechanize doesn't work when HTTPS and Proxy Authentication required ) I have to go through proxy-server when I access the Internet. The proxy-server requires authentication. I wrote the following codes. import requests from requests.auth import HTTPProxyAuth proxies = {"http":"192.168.20.130:8080"} auth = HTTPProxyAuth("username", "password") r = requests.get("http://www.google.co.jp/", proxies=proxies, auth=auth) The above codes work well when proxy-server requires basic authentication. Now I want to know