我正在尝试设置使用WSO2 IS通过SAML2进行身份验证的服务提供商。现在,我们有一个用例,其中用户是需要访问服务提供商的机器(即外部程序)。由于用户是机器,因此没有浏览器,并且无法使用WSO2登录表单来完成身份验证步骤,尽管由于仍是用户,所以已为其提供了用户名和密码。
我的问题是,这个非GUI用户如何才能参与SAML2工作流程(特别是将凭据传递给WSO2以获取SAMLV2声明消息)并访问服务提供商?
我尝试进行以下模拟操作,但失败了
1) curl -v -k http://localhost:8000/service_provider/login
2) Extracting the SAML message from the response:
curl --user username:password -v -k https://localhost:9443/samlsso?SAMLRequest=<ENCODED_REQUEST>
基本上,我期望通过SAML声明消息从WSO2返回到服务提供商的重定向响应,但是我得到了以下内容:https:// localhost:9443 / authenticationendpoint / login.do; jsessionid = 7QON18982323HWIH?commonAuthCallerPath =% 2Fsamlsso&forceAuth = false&passiveAuth = false&tenantDomain = carbon.super&sessionDataKey = 122JhQ-JQOJ-H8123&relyingParty = test-saml2&type = samlsso&sp = test&isSaaSApp = false&authenticators = BasicAuthenticator = LOCAL的用户使用与用户身份验证相同的身份验证器:LOCAL。
我还尝试按照本文中的建议将HTTP-POST绑定与“ sectoken”表单参数一起使用:http : //xacmlinfo.org/2015/02/12/sso-without-identity-provider-login-page/。但这也不起作用。
我还尝试了向WSO2的AuthenticationAdminHttpsSoap12Endpoint服务发出SOAP请求,特别是“登录”方法。我使用了从SOAP响应中获得的JSESSIONID来执行上述步骤,但是效果是相同的。这对我来说并不奇怪,因为WSO2不使用JSESSIONID来检查您是否已通过身份验证(至少不是为了尝试获取SAML响应)。
1.Get login form
Request
curl -v http://localhost:8000/service_provider/login
Response
Extract SAMLRequest and SSOAuthSessionID (if RelayState presents extract it too)
2.Send saml request to IDP using extracted valuses in step1(In browser this will happen through redirection)
Request
Endpoint : https://<is_host>:9443/samlsso
Verb :post
Content-Type:application/x-www-form-urlencoded
Parameters:[
SAMLRequest:<value from previous step>,
SSOAuthSessionID:<value from previous step>,
RelayState :<value from previous step>]
Response
This will give IS login page.Extract sessionDataKey from that.
3. Login by providing user name password
Reqeust
Endpoint:https://<is_host>:9443/commonauth
Content-Type:application/x-www-form-urlencoded
Verb :post
Parameters: [tocommonauth:true,username:xxxx,password:xxx,sessionDataKey:<extracted from previous step>]
Response
Extract SAML response
5.Post the saml resposne to ACS url of service provider
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句