【问题标题】:Authenticate against WSO2 Identity Server with no browser and get SAML2 assertion message在没有浏览器的情况下针对 WSO2 身份服务器进行身份验证并获取 SAML2 断言消息
【发布时间】:2016-12-03 14:07:58
【问题描述】:

我正在尝试设置一个使用 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,与人类用户使用浏览器进行身份验证时使用的 URL 相同。

我还尝试按照本文中的建议使用带有“sectoken”表单参数的 HTTP-POST 绑定:http://xacmlinfo.org/2015/02/12/sso-without-identity-provider-login-page/。但这也没有用。

我还尝试向 WSO2 的 AuthenticationAdminHttpsSoap12Endpoint 服务发出 SOAP 请求,特别是“登录”方法。我使用了从 SOAP 响应中获得的 JSESSIONID,但效果是一样的。这对我来说并不奇怪,因为 WSO2 不使用 JSESSIONID 来检查您是否已经通过身份验证(至少不是为了尝试获取 SAML 响应)。

【问题讨论】:

    标签: wso2 saml-2.0 wso2is


    【解决方案1】:
    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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-05-12
      • 1970-01-01
      • 2015-06-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-17
      • 1970-01-01
      相关资源
      最近更新 更多