basic-authentication

HTTP Spec: Proxy-Authorization and Authorization headers

情到浓时终转凉″ 提交于 2019-11-27 09:15:47
问题 So I'm trying to implement the following scenario: An application is protected by Basic Authentication. Let's say it is hosted on app.com An HTTP proxy, in front of the application, requires authentication as well. It is hosted on proxy.com The user must therefore provide credentials for both the proxy and the application in the same request, thus he has different username/password pairs: one pair to authenticate himself against the application, and another username/password pair to

Basic Authentication With XMLHTTPRequest

假如想象 提交于 2019-11-27 08:53:09
I am attempting to use XMLHTTPRequest to get an update on twitter. var XMLReq = new XMLHttpRequest(); XMLReq.open("GET", "http://twitter.com/account/verify_credentials.json", false, "TestAct", "password"); XMLReq.send(null); However, using my sniffer I cannot see any authorization headers being passed through. Hence, I get a 401 error response from Twitter. The account and password are correctly entered. Anyone attempt this? Can anyone give me some pointers? Thank you. You just need to add a Authorization header, an user name and password in a base64 encoded string as follows. XMLReq

HttpClientBuilder basic auth

匆匆过客 提交于 2019-11-27 08:22:16
Since HttpClient 4.3, I have been using the HttpClientBuilder. I am connecting to a REST service that has basic authentication. I am setting the credentials as follows: HttpClientBuilder builder = HttpClientBuilder.create(); // Get the client credentials String username = Config.get(Constants.CONFIG_USERNAME); String password = Config.get(Constants.CONFIG_PASSWORD); // If username and password was found, inject the credentials if (username != null && password != null) { CredentialsProvider provider = new BasicCredentialsProvider(); // Create the authentication scope AuthScope scope = new

How to assign UrlFetchApp with basic authorization to button?

天涯浪子 提交于 2019-11-27 07:25:15
问题 I created function in Google Apps Script, that works well when I run it in Google Apps Script. Output data returns to Google Sheets. function testFunction11() { var rng = SpreadsheetApp.getActiveRange(); var encodedAuthInformation = Utilities.base64Encode("username:key"); var headers = {"Authorization" : "Basic " + encodedAuthInformation}; var params = { 'method': 'GET', 'muteHttpExceptions': true, 'headers': headers }; var res = UrlFetchApp.fetch("https://api.apiservice.com/api/v1/xxx?fields

HTTP Basic Authentication issue on Android Jelly Bean 4.1 using HttpURLConnection

风流意气都作罢 提交于 2019-11-27 07:04:40
问题 We are making HttpURLConnection based request to the Web server using HTTP Basic Authentication. Code works great on Android versions 2.x, 3.x., 4.0.x Now with Jelly Bean and v4.1.x authentication fails with the following messages in the LogCat: 01-27 10:54:18.886: ...::doReadRawData(731): An exception occured while reading data from remote host. httpURLConn.responseCode = 401 / httpURLConn.responseMessage = UNAUTHORIZED 01-27 10:54:18.886: ...::doReadRawData(731): java.io.IOException: No

Flask HTTP Basicauth - How does it work?

丶灬走出姿态 提交于 2019-11-27 06:18:52
问题 I'm trying to create a login system using Flask and HTTP Basic Auth. My question is, is it my responsibility to provide user information from databases, or does basicauth create and access those databases for me? If it doesn't, what can I use to do that? 回答1: Werkzeug can decode the Basic Authorization header for you, into the username and password. The rest is up to you to see what you want to do with that information. The request.authorization attribute returns a Authorization object. For

Centrally secure all tomcat webapps using BASIC authentication

五迷三道 提交于 2019-11-27 06:06:52
问题 I have a Tomcat 6 server containing three webapps: a custom one as ROOT, Jenkins and Nexus. I would like to secure all three centrally (server.xml?) using BASIC authentication. How can I achieve this without modifying or configuring the webapps themselves? 回答1: First I tried (without success) to include the BasicAuthenticator valve in conf/context.xml . This didn't seem to have any effect. Finally I got it to work (secured all webapps) by adding this snippet to conf/web.xml : <security

Send authentication information with Volley request

一笑奈何 提交于 2019-11-27 06:05:52
问题 In my Android app I have to call a web service which looks like this http://mywesite.com/demo/mob/getmenubycategory/1 I am using the volley to send the request but the result is VolleyError 401 . I have overridden the getParams() method to add the header, but it is not working. Here is my code. RequestQueue requestQueue = volleySingleton.getRequestQueue(); requestQueue.add(new JsonObjectRequest(Request.Method.GET, url, new Response.Listener<JSONObject>() { @Override public void onResponse

how to do Auth in node.js client

倖福魔咒の 提交于 2019-11-27 05:59:50
问题 I want to get use this rest api with authentication. I'm trying including header but not getting any response. it is throwing an output which it generally throw when there is no authentication. can anyone suggest me some solutions. below is my code var http = require('http'); var optionsget = { host : 'localhost', // here only the domain name port : 1234, path:'/api/rest/xyz', headers: { 'Authorization': 'Basic ' + new Buffer('abc'+ ':' + '1234').toString('base64') } , method : 'GET' // do

iOS: Authentication using XMLHttpRequest - Handling 401 response

守給你的承諾、 提交于 2019-11-27 05:59:26
问题 I'm writing an iOS application using PhoneGap (aka Cordova), I have a simple html login page that logs the user in using an XMLHttpRequest with basic authentication over SSL. Everything works splendidly when you enter your username and password correctly. However, if you enter the wrong username/password none of my callbacks are ever called. If you run the same code on Chrome for example, with the wrong username/password, chrome behaves in a similar manner, except it pops up an authentication