将以下curl命令转换为等效的Java代码

时间:2016-12-01 16:41:19

标签: java curl cookies httpclient centrify

我正在尝试使用centrify API

以下curl命令正常工作

curl -H "X-CENTRIFY-NATIVE-CLIENT:1" -H "Content-type: application/json" -d     "{User: '*****,Version: '1.0', TenantId: ''  }"     'https://****.cellwe.samsungknox.com/Security/StartAuthentication' --dump-header     headers.txt

curl -H "X-CENTRIFY-NATIVE-CLIENT:1" -H "Content-type: application/json" -d "{TenantId: '***', SessionId: 'qyrOp_Dvg-btRLQRtjzS2n1AeE2s3tpDh1V68A3TM8Y1', MechanismId: 'tKrhMSCSkUCGzPj2C1aTg1fFrWc75XY-BOhuu63qa9k1',Action: 'Answer', Answer: '****'}"  'https://****.cellwe.samsungknox.com/security/AdvanceAuthentication' --dump-header headers.txt

curl -H "X-CENTRIFY-NATIVE-CLIENT:1" -H "Content-type: application/json" -d "{UUID:'*****'}"  -b headers.txt 'https://****.cellwe.samsungknox.com/UserMgmt/GetUserInfo'

我无法编写等效的java代码,因为某些cookie不会通过请求传输。

请参阅以下API指南以及.net

中的示例程序

API指南 http://developer.centrify.com/site/global/documentation/api_guide/using_the_api/index.gsp

示例程序 http://community.centrify.com/t5/TechBlog/Customized-Integration-of-Centrify-User-Suite-All-About-REST/ba-p/18769

0 个答案:

没有答案