如何在Apache Knox中启用SSO?

时间:2018-07-13 20:12:43

标签: apache

我正在努力为我们的客户端在Apache Knox中启用SAML身份验证。在KNOX中设置与SSO相关的配置后,目前我遇到的问题很少。

启动网关后访问YarnUI时,浏览器将重定向到身份提供者URL->要求登录凭据->提交用户时,要进行身份验证,但应用程序将降落到https://emr-knox-webui-dev.us-west-2.elb.amazonaws.com:8446并抛出找不到页面错误。

我看到发送了SAML请求,并收到了SAML响应,但是经过身份验证后,它会登陆到无效页面。身份验证后,我无法确定要登陆的页面。

我们的客户使用:Ping联合身份提供者。下面列出了配置设置,并随附了屏幕截图,以使您更好地理解。

IDP->配置

实体ID-https://emr-knox-webui-dev.us-west-2.elb.amazonaws.com:8446/gateway/knoxsso/api/v1/websso?pac4jCallback=true&client_name=SAML2Client TargetURL-https://emr-knox-webui-dev.us-west-2.elb.amazonaws.com:8446(我不确定目标URL是否有效,我怀疑授权后页面已重定向到此链接)

KnoxSSO.xml

<topology>
   <gateway>
     <provider>
         <role>federation</role>
         <name>pac4j</name>
         <enabled>true</enabled>
         <param>
          <name>pac4j.callbackUrl</name>
          <value>https://emr-knox-webui-dev.us-west-2.elb.amazonaws.com:8446/gateway/knoxsso/api/v1/websso</value>
         </param>

         <param>
           <name>clientName</name>
           <value>SAML2Client</value>
         </param>

         <param>
           <name>saml.identityProviderMetadataPath</name>
           <value>/tmp/preprod_metadata_SP.xml</value>
         </param>

         <param>
           <name>saml.serviceProviderMetadataPath</name>
           <value>/tmp/preprod_metadata_SP.xml</value>
         </param>

         <param>
           <name>saml.serviceProviderEntityId</name>
           <value>https://emr-knox-webui-dev.us-west-2.elb.amazonaws.com:8446/gateway/knoxsso/api/v1/websso?pac4jCallback=true&amp;client_name=SAML2Client</value>
         </param>
     </provider>
     <provider>
         <role>identity-assertion</role>
         <name>Default</name>
         <enabled>true</enabled>
     </provider>
   </gateway>

   <service>
       <role>KNOXSSO</role>
       <param>
         <name>knoxsso.cookie.secure.only</name>
         <value>true</value>
      </param>
      <param>
        <name>knoxsso.token.ttl</name>
        <value>100000</value>
      </param>
      <param>
         <name>knoxsso.redirect.whitelist.regex</name>
         <value>^https?:\/\/(emr-knox-webui-dev\.us-west-2\.elb\.amazonaws\.com|localhost|127\.0\.0\.1|0:0:0:0:0:0:0:1|::1):[0-9].*$</value>
      </param>
   </service>
</topology>

gate1.xml

<?xml version="1.0" encoding="utf-8"?>
<topology>
  <gateway>
    <provider>
        <role>federation</role>
        <name>SSOCookieProvider</name>
        <enabled>true</enabled>
        <param>
            <name>sso.authentication.provider.url</name>
            <value>https://emr-knox-webui-dev-1021294088.us-west-2.elb.amazonaws.com:8446/gateway/knoxsso/api/v1/websso</value>
        </param>
    </provider>
    <provider>
        <role>identity-assertion</role>
        <name>Default</name>
        <enabled>true</enabled>
    </provider>
  </gateway>
  <service>
      <role>YARNUI</role>
      <url>http://ip-10-89-71-228.vpc.internal:8088</url>
  </service>
</topology>

0 个答案:

没有答案