s****y 发帖数: 503 | 1 我要访问一个有安全认证的Web Service,他们提供了SOAP和WSDL,我在SoapUI里,输
入了username和password,能得到响应,他们说Web Service用的是Basic的认证。那么
username和password是怎么传输的?是http://xxx/xxxService?userId=&password=这样?还是存在SOAP报文里?
还有在我用wsimport生成的客户端代码里怎么处理username和password?我在哪里输入
username和password? |
l**********n 发帖数: 8443 | 2 这个简单吧,就是弹出个dialog,要求输入用户名,密码 |
s****y 发帖数: 503 | 3
用网页直接访问是这样,在SoapUI里也有地方输入密码和用户名,但是在wsimport生成
的客户端的代码里怎么处理username和password?
【在 l**********n 的大作中提到】 : 这个简单吧,就是弹出个dialog,要求输入用户名,密码
|
l**********n 发帖数: 8443 | 4 add a header
【在 s****y 的大作中提到】 : : 用网页直接访问是这样,在SoapUI里也有地方输入密码和用户名,但是在wsimport生成 : 的客户端的代码里怎么处理username和password?
|
c*********e 发帖数: 16335 | 5 rt
【在 l**********n 的大作中提到】 : add a header
|
s****y 发帖数: 503 | 6
是给Http加个header,然后写入username=XXX password=XXX?
【在 l**********n 的大作中提到】 : add a header
|
g*****g 发帖数: 34805 | 7 If you are using SOAP, you should use a web service client, and it should
have examples.
I don't think username/password should be passed in header.
【在 s****y 的大作中提到】 : : 是给Http加个header,然后写入username=XXX password=XXX?
|
c*********e 发帖数: 16335 | 8 en,而且,c#,java的soap的写法也不同。找个例子,改改就成你的了。
【在 g*****g 的大作中提到】 : If you are using SOAP, you should use a web service client, and it should : have examples. : I don't think username/password should be passed in header.
|
l******t 发帖数: 55733 | |
a*********y 发帖数: 63 | 10 正确。
HTTP Basic Authentication 在 SOAP Authentication 之前。如果你通不过认证,你
看不见SOAP Endpoint.这是一种常见的保护 Web Service 的方式。
【在 s****y 的大作中提到】 : : 是给Http加个header,然后写入username=XXX password=XXX?
|
|
|
a****i 发帖数: 1182 | 11 这个是挺标准的OAuth2吧
用token啊
【在 s****y 的大作中提到】 : 我要访问一个有安全认证的Web Service,他们提供了SOAP和WSDL,我在SoapUI里,输 : 入了username和password,能得到响应,他们说Web Service用的是Basic的认证。那么 : username和password是怎么传输的?是http://xxx/xxxService?userId=&password=这样?还是存在SOAP报文里? : 还有在我用wsimport生成的客户端代码里怎么处理username和password?我在哪里输入 : username和password?
|
a9 发帖数: 21638 | 12 这怎么会是oauth2。
http://lmgtfy.com/?q=http+basic+authentication
,输
那么
输入
【在 a****i 的大作中提到】 : 这个是挺标准的OAuth2吧 : 用token啊
|
a****i 发帖数: 1182 | 13 哦,没看清题,以为是要选一个技术来实现
不过我的意思是说web service 是用token而不是username/password来做security
从wiki来看,Basic也是在头里发个 Authorization: Basic aHR0cHdhdGNoOmY=
用户名和密码用来拿token,拿到以后就不需要了,是这样吧?
【在 a9 的大作中提到】 : 这怎么会是oauth2。 : http://lmgtfy.com/?q=http+basic+authentication : : ,输 : 那么 : 输入
|
g*****g 发帖数: 34805 | 14 authenticated之后会发个session cookie.
【在 a****i 的大作中提到】 : 哦,没看清题,以为是要选一个技术来实现 : 不过我的意思是说web service 是用token而不是username/password来做security : 从wiki来看,Basic也是在头里发个 Authorization: Basic aHR0cHdhdGNoOmY= : 用户名和密码用来拿token,拿到以后就不需要了,是这样吧?
|
o*********r 发帖数: 203 | 15 Add header to call (i.e. in jQuery):
$.ajax({url : ,
type : 'get',
contentType : 'application/json',
dataType : 'json',
cache : false,
headers : {'Authorization' : "Basic cmVtb3RlMTpyZW1vdGUx"}};
'cmVtb3RlMTpyZW1vdGUx' is a base64-encoded string. The plain text is <
username>: |
f*********t 发帖数: 17 | 16 Right. This is http standard header.
If using oauth the header becomes Authorization: Bearer {access_token}
【在 a****i 的大作中提到】 : 哦,没看清题,以为是要选一个技术来实现 : 不过我的意思是说web service 是用token而不是username/password来做security : 从wiki来看,Basic也是在头里发个 Authorization: Basic aHR0cHdhdGNoOmY= : 用户名和密码用来拿token,拿到以后就不需要了,是这样吧?
|