Android的 - 基本身份验证的HTTP请求 [英] Android - Basic Authenticated HTTP Request

查看:130
本文介绍了Android的 - 基本身份验证的HTTP请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以基本上我需要我的Andr​​oid应用程序使用URL连接到Web服务这样
HTTP://用户名:password@0.0.0.0又名基本身份验证。
很明显,用户名和密码是由web应用程序允许访问否则不允许的请求前检查。

So basically i need my android app to connect to a web service using a url as such "http://username:password@0.0.0.0" aka basic authentication. obviously the username and password are checked by the web app before allowing access and otherwise doesn't allow the request.

我的问题是,所有我尝试总是说的方法未经授权(响应code 401),无论香港专业教育学院用于尝试连接的网址是什么类和方法的组合。

my issue is that all the methods i try always say unauthorised (response code 401) regardless of what combination of classes and methods ive used to try and connect to the the url.

有问题的Web应用程序被设计为返回的东西不仅是UN / PW清除否则它没有返回值,Web应用程序和UN / PW等等都进行检查和清除。

The web app in question is designed to return things only is un/pw clears otherwise it returns nothing, the web app and un/pw etc have all be checked and cleared.

因此​​,没有人不会送这样的URL请求正确的方法,并将它正常工作?

so does anyone no the correct way to send a request to a url like that and have it work correctly?

安卓api8 BTW

android api8 btw

更新
原来我的问题是,由于它不受机器人/的Apache HTTP库直接支持的Web应用程序使用NTLM Windows身份验证,目前正在研究相应的解决办法。

UPDATE Turns out my issue is due to the web app using NTLM windows authentication which is not supported directly by androids/apache http library, investigating appropriate workarounds now

推荐答案

对于所有寻找一个解决方案NTLM身份验证此页面介绍necassary东西

For all looking for a solution to NTLM Authentication this page here describes the necassary stuff

http://hc.apache.org/httpcomponents-client-ga/tutorial/html/authentication.html#ntlm

这篇关于Android的 - 基本身份验证的HTTP请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆