digest-authentication

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

送分小仙女□ 提交于 2019-11-29 12:27:10
问题 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

How to configure JBoss DatabaseServerLoginModule for Digest Authentication in a Web Application

被刻印的时光 ゝ 提交于 2019-11-29 11:12:58
In a sentence, I want to configure JBoss 4.2.2 to use DatabaseServerLoginModule as the login-module for a Web application that is secured via Digest Authentication. The problem I am having is that the passwords fail to validate. I suspect the issue is either in how I've defined the application policy or in how the passwords are stored in the database. Below are all the relevant files. I have a MySQL database with users and roles defined using the following schema: CREATE TABLE SR_USER ( ID BIGINT(19) NOT NULL AUTO_INCREMENT, USERNAME VARCHAR(20) NOT NULL, PASSWORD VARCHAR(255) NOT NULL,

Apache HTTPClient DigestAuth doesn't forward “opaque” value from Challenge

╄→尐↘猪︶ㄣ 提交于 2019-11-28 14:37:13
I'm trying to use Digest authentication with HTTP Client against a 3rd-party web service that I don't control. I started out with the sample code from here: http://hc.apache.org/httpcomponents-client-4.5.x/httpclient/examples/org/apache/http/examples/client/ClientPreemptiveDigestAuthentication.java I got it working against httpbin.org , before attempting the next step described below. It appears that the target 3rd-party service that I'm using requires the opaque value to be copied from the WWW-Authentication header on the initial response to the Authorization header on the next request, as

Is Digest authentication possible with jQuery?

天涯浪子 提交于 2019-11-27 17:43:26
I'm trying to send a request that requires HTTP Digest authentication. Is Digest possible in jQuery? If so, is this close to the correct way to do it? It's not currently working. <script type="text/javascript"> $.ajax({ url: url, type: 'GET', dataType: 'json', success: function() { alert('hello!'); }, error: function() { alert('error')}, beforeSend: setHeader }); function setHeader(xhr){ xhr.setRequestHeader("Authorization", "Digest username:password"); xhr.setRequestHeader("Accept", "application/json"); } </script> No, the Digest Access Authentication Scheme is a little more complex as it

Digest authentication in Android using HttpURLConnection

女生的网名这么多〃 提交于 2019-11-27 15:18:48
as the question allready says, I am trying to do digest authentication in android. Until now i have used the DefaultHttpClient and it's authentication method (using UsernamePasswordCredentials and so on), but it is deprecated since Android 5 and will be removed in Android 6. So i am about to switch from DefaultHttpClient to HttpUrlConnection . Now i am trying to achieve digest authentication, which should work pretty simple as explained here : Authenticator.setDefault(new Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(username

What is digest authentication?

醉酒当歌 提交于 2019-11-27 10:15:49
How does Digest Authentication differ from Basic Authentication other than sending credentials as plain text? Ian C. The main difference is that it doesn't require sending the username and password across the wire in plaintext. It is also immune to replay-attacks, as it uses a one-time number from the server. The server gives the client a one-time use number (a nonce) that it combines with the username, realm, password and the URI request. The client runs all of those fields through an MD5 hashing method to produce a hash key. It sends this hash key to the server along with the username and

Apache HTTPClient DigestAuth doesn't forward “opaque” value from Challenge

六眼飞鱼酱① 提交于 2019-11-27 08:42:18
问题 I'm trying to use Digest authentication with HTTP Client against a 3rd-party web service that I don't control. I started out with the sample code from here: http://hc.apache.org/httpcomponents-client-4.5.x/httpclient/examples/org/apache/http/examples/client/ClientPreemptiveDigestAuthentication.java I got it working against httpbin.org , before attempting the next step described below. It appears that the target 3rd-party service that I'm using requires the opaque value to be copied from the

Is Digest authentication possible with jQuery?

六眼飞鱼酱① 提交于 2019-11-27 04:13:34
问题 I'm trying to send a request that requires HTTP Digest authentication. Is Digest possible in jQuery? If so, is this close to the correct way to do it? It's not currently working. <script type="text/javascript"> $.ajax({ url: url, type: 'GET', dataType: 'json', success: function() { alert('hello!'); }, error: function() { alert('error')}, beforeSend: setHeader }); function setHeader(xhr){ xhr.setRequestHeader("Authorization", "Digest username:password"); xhr.setRequestHeader("Accept",

Apache HttpClient Digest authentication

爱⌒轻易说出口 提交于 2019-11-26 22:53:05
Basically what I need to do is to perform digest authentication. First thing I tried is the official example available here . But when I try to execute it(with some small changes, Post instead of the the Get method) I get a org.apache.http.auth.MalformedChallengeException: missing nonce in challange at org.apache.http.impl.auth.DigestScheme.processChallenge(DigestScheme.java:132) When this failed I tried using: DefaultHttpClient client = new DefaultHttpClient(); client.getCredentialsProvider().setCredentials(new AuthScope(null, -1, null), new UsernamePasswordCredentials("<username>", "

Android: Volley HTTP Request custom header

倾然丶 夕夏残阳落幕 提交于 2019-11-26 20:58:39
I'm getting the following error when I run the app: BasicNetwork.performRequest: Unexpected response code 401 I need to pass an email, a password and a token to access the URL, but it's not working I started learn android last week, I don't know much package quest.testvolley; import com.android.volley.AuthFailureError; import com.android.volley.VolleyLog; import com.kpbird.volleytest.R; import android.app.ProgressDialog; import android.os.Bundle; import android.app.Activity; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.View; import