http-authentication

RestTemplate basic or digest Authentication with the current httpclient (4.x)

懵懂的女人 提交于 2019-11-29 14:04:01
问题 I'm trying to do Digest mostly (or Basic) Authentication using RestTemplate and httpclient (4.x) . Since I couldn't find any relevant examples of how to actually do this, I have attempted various ways to hook the various httpclient artifacts, with no luck - essentially, no Authentication header is sent at all. My current implementation is: DefaultHttpClient newHttpClient = new DefaultHttpClient(); Credentials credentials = new UsernamePasswordCredentials( username, password ); AuthScope

How can I use Basic HTTP Authentication in PHP?

一个人想着一个人 提交于 2019-11-29 11:42:47
问题 I'm trying to use Basic HTTP Authentication and followed the example on the PHP manual page. But it doesn't work for me. The variable $_SERVER['PHP_AUTH_USER'] doesn't seem to be set. When a user try to log in, the user is prompted whith a new login-dialog. The server is running PHP 5.3.3 and I have tried with Google Chrome and Internet Explorer. Here is the simple example that I used: <?php if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="Jonas Realm"'); header

IIS7 and Authentication problems

北战南征 提交于 2019-11-29 10:50:48
i've got a stock standard ASP.NET web site, deployed to our development machine (internal machine in our server room). Now, this dev site can be accessed by both INTERNAL and EXTERNAL users. Now, in IIS6 we used to have it so that Anonymous Authentication was turned off and something else was turned on .. giving the users a popup model box for username and password. I think they had to type some username or password that was defined in a web.config file? (not their website account username/password)/ Now, with IIS7, when i turn Anon Auth off , and turn on Basic or Windows Auth , i get access

How can I send HTTP Basic Authentication headers in Android?

穿精又带淫゛_ 提交于 2019-11-29 08:04:09
I am not sure how to send HTTP Auth headers. I have the following HttpClient to get requests, but not sure how I can send requests? public class RestClient extends AsyncTask<String, Void, JSONObject> { private String convertStreamToString(InputStream is) { /* * To convert the InputStream to String we use the * BufferedReader.readLine() method. We iterate until the * BufferedReader return null which means there's no more data to * read. Each line will appended to a StringBuilder and returned as * String. */ BufferedReader reader = new BufferedReader(new InputStreamReader(is)); StringBuilder sb

How do I provide basic http authentication for static tomcat webapps without changing tomcat-users.xml?

耗尽温柔 提交于 2019-11-29 06:15:20
I have access to the tomcat manager and can upload war-files. One of these wars is a static web project (zipped html + media files, renamed to *.war). I want add a Web-INF/web.xml file to this war to protect the content with basic http auth. I know how to do this by adding global users and assigning roles in the tomcat-users.xml , but I want to have all usernames and passwords defined in my war-file. Can this be done without touching the tomcat's tomcat-users.xml ? And if yes, how do I specify this in my static project's web.xml ? Thx, Juve Juve I found a solution here: http://wiki.metawerx

PHP CURL returns nothing

两盒软妹~` 提交于 2019-11-29 03:02:01
function ParseUrl($URL) { $crl = curl_init(); curl_setopt ($crl, CURLOPT_URL, $URL); curl_setopt ($crl, CURLOPT_PORT, 8086); curl_setopt ($crl, CURLOPT_USERPWD, "admin:pass"); curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, 5); $ret = curl_exec($crl); curl_close($crl); return $ret; } echo ParseUrl('http://xxx.me/serverinfo'); The code above simply returns nothing. The page I am trying to get with curl uses http authentication thing. Am I missing something simple or what? Start out by doing this and see what you get, and after that it would be pretty

PHP CURL returns nothing

筅森魡賤 提交于 2019-11-29 03:00:18
function ParseUrl($URL) { $crl = curl_init(); curl_setopt ($crl, CURLOPT_URL, $URL); curl_setopt ($crl, CURLOPT_PORT, 8086); curl_setopt ($crl, CURLOPT_USERPWD, "admin:pass"); curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, 5); $ret = curl_exec($crl); curl_close($crl); return $ret; } echo ParseUrl('http://xxx.me/serverinfo'); The code above simply returns nothing. The page I am trying to get with curl uses http authentication thing. Am I missing something simple or what? Start out by doing this and see what you get, and after that it would be pretty

How do I use libcurl to login to a secure website and get at the html behind the login

时光总嘲笑我的痴心妄想 提交于 2019-11-29 02:29:56
Hey guys, I was wondering if you guys could help me work through accessing the html behind a login page using C and libcurl. Specific Example: The website I'm trying to access is https://onlineservices.ubs.com/olsauth/ex/pbl/ubso/dl Is it possible to do something like this? The problem is that we have a lot of clients each of which has a separate login. We need to get data from each of their accounts every day. It would be really slick if we could write something in C to do this and save all the pertinent data into a file. (like the values of the accounts and positions which I can parse from

HTTP Authentication (Basic or Digest) in ASP Classic via IIS [closed]

别等时光非礼了梦想. 提交于 2019-11-28 23:57:09
I want to develop a website in ASP classic that uses HTTP Authentication against a database or password list that is under the control of the script. Ideally, the solution should involve no components or IIS settings as the script should be runnable in a hosted environment. Any clues/code deeply appreciated. It is possible to do HTTP Basic Authentication in pure classic ASP VBScript. You will need something to decode base 64. Here is a pure VBScript implementation . You will also need to make sure that in your IIS config you turn off "Basic authentication" and "Integrated Windows

Authentication issues with WWW-Authenticate: Negotiate

喜夏-厌秋 提交于 2019-11-28 20:54:13
问题 I am trying to access a site that is password protected. It is not using basic authentication (even though the same user/pass box pops up in firefox) as the response header is WWW-Authenticate: Negotiate . I want to automate the login process by sending the correct header. In basic you would use something like: Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== What would I use for negotiate? 回答1: The web server is prompting you for a SPNEGO ( Simple and Protected GSSAPI Negotiation Mechanism