成功登录SSO后,Jira 7的CAS重定向到Jira登录页面

时间:2018-10-30 15:14:20

标签: single-sign-on jira cas jasig

我要做的是使用Apereo Java CAS Client将Jira 7.12.3与SSO服务器集成在一起。

我遵循了this的指导,并从here获得了两个所需的罐子。

我已将CAS与JIRA集成在一起,如此处所述,但是当我打开jira时,用户将重定向到/secure/Dashboard.jspa(jira登录页面)。通过单击右上角的登录名,cas页面将打开,但是成功登录后,用户将被重定向回JIRA登录页面,而用户仍未在此处登录。谁能帮我解决这个问题?

这是我添加的配置:

web.xml:

<!-- CAS FILTER -->
<filter>
  <filter-name>CasSingleSignOutFilter</filter-name>
  <filter-class>org.jasig.cas.client.session.SingleSignOutFilter</filter-class>
  <init-param>
       <param-name>casServerUrlPrefix</param-name>
       <param-value>https://[sso url]</param-value>
   </init-param>
</filter>
<filter>
 <filter-name>CasAuthenticationFilter</filter-name>
<filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
 <init-param>
 <param-name>casServerLoginUrl</param-name>
 <param-value>https://[sso url]/login</param-value>
 </init-param>
 <init-param>
   <param-name>serverName</param-name>
   <param-value>http://localhost:8080/</param-value>
 </init-param>
</filter>
<filter>
   <filter-name>CasValidationFilter</filter-name>
   <filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class>
   <init-param>
       <param-name>casServerUrlPrefix</param-name>
       <param-value>https://[sso url]</param-value>
   </init-param>
   <init-param>
       <param-name>serverName</param-name>
       <param-value>http://localhost:8080/</param-value>
   </init-param>
   <init-param>
       <param-name>redirectAfterValidation</param-name>
       <param-value>true</param-value>
   </init-param>
</filter>
<!-- Just before the last filter in the defined chain -->

<!-- CAS - Java Client Filter Mappings --> 
<filter-mapping>
   <filter-name>CasSingleSignOutFilter</filter-name>
   <url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
    <filter-name>CasAuthenticationFilter</filter-name>
    <url-pattern>/default.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
    <filter-name>CasValidationFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<!-- CAS:START - Java Client Single Sign Out Listener -->
<listener>
    <listener-class>org.jasig.cas.client.session.SingleSignOutHttpSessionListener</listener-class>
</listener>
<!-- CAS:END -->

seraph-config.xml:

<init-param>
   <param-name>login.url</param-name>
        <!--<param-value>/login.jsp?permissionViolation=true&amp;os_destination=${originalurl}&amp;page_caps=${pageCaps}&amp;user_role=${userRole}</param-value>-->
        <param-value>https://[sso url]/login?service=${originalurl}</param-value>
</init-param>
<init-param>
   <param-name>link.login.url</param-name>
        <param-value>https://[sso url]/login?service=${originalurl}</param-value>
 </init-param>
 <init-param>
    <param-name>logout.url</param-name>
    <!--<param-value>/secure/Logout!default.jspa</param-value>-->
    <param-value>https://[sso url]/logout</param-value>
 </init-param>

 <!-- Inserted this Authenticator instead of JiraSeraphAuthenticator -->
<authenticator class="org.jasig.cas.client.integration.atlassian.Jira7CasAuthenticator">
    <init-param>
        <param-name>casServerUrlPrefix</param-name>
        <param-value>https://[sso url]</param-value>
    </init-param>
    <init-param>
        <param-name>serverName</param-name>
        <param-value>http://localhost:8080</param-value>
    </init-param>
</authenticator>

1 个答案:

答案 0 :(得分:0)

问题是我将我的jira-url插入为“ localhost:8080”。因此,我的cas服务器无法通过url中的service-parameter唯一标识服务。

这对于其他有类似问题的人可能会有所帮助。