opencast / opencast-docker

Dockerfiles for Opencast
https://quay.io/organization/opencast/
Educational Community License v2.0
41 stars 36 forks source link

CAS Authentication Server Error 500 #173

Closed varadbhogayata closed 2 years ago

varadbhogayata commented 2 years ago

Hi,

I have been using opencast-docker for 2 years and it's been in use for storing university videos. Currently, we updated our Ubuntu server which caused this issue. I'm using docker-compose.allinone.mariadb.yml for installation. In order to enable CAS Authentication, I have made changes which are mentioned below (changes are made at docker level):

1) To make changes at docker level: docker exec -it /bin/bash 2) File Path: /opencast/etc/org.apache.karaf.features.cfg, append "opencast-security-cas" to variable featureBoot 3) File Path: /opencast/etc/security/mh_default_org.xml, append this for CAS

<!-- ############### -->
  <!-- # CAS Support # -->
  <!-- ############### -->

  <bean id="casFilter"
    class="org.springframework.security.cas.web.CasAuthenticationFilter">
    <property name="authenticationManager" ref="authenticationManager"/>
    <property name="authenticationSuccessHandler" ref="authSuccessHandler" />
    <property name="serviceProperties" ref="serviceProperties" />
    <property name="authenticationDetailsSource">
      <bean class="org.springframework.security.cas.web.authentication.ServiceAuthenticationDetailsSource"/>
    </property>
  </bean>

  <bean id="casEntryPoint"
    class="org.springframework.security.cas.web.CasAuthenticationEntryPoint">
    <property name="loginUrl" value="https://weblogin.asu.edu/cas/login"/>
    <property name="serviceProperties" ref="serviceProperties"/>
  </bean>

  <bean id="serviceProperties"
    class="org.springframework.security.cas.ServiceProperties">
    <property name="service" value="https://<server>/j_spring_cas_security_check"/>
    <property name="sendRenew" value="false"/>
  </bean>

  <bean id="casAuthenticationProvider"
    class="org.springframework.security.cas.authentication.CasAuthenticationProvider">
    <property name="serviceProperties" ref="serviceProperties" />
    <property name="authenticationUserDetailsService">
      <bean class="org.springframework.security.core.userdetails.UserDetailsByNameServiceWrapper">
          <constructor-arg ref="userDetailsService" />
      </bean>
    </property>
    <property name="ticketValidator">
      <bean class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator">
        <constructor-arg index="0" value="https://weblogin.asu.edu/cas" />
      </bean>
    </property>
    <property name="key" value="cas"/>
  </bean>

  <!-- This filter handles a Single Logout Request from the CAS Server -->
  <bean id="singleLogoutFilter" class="org.jasig.cas.client.session.SingleSignOutFilter"/>

  <!-- This filter redirects to the CAS Server to signal Single Logout should be performed -->
  <bean id="requestSingleLogoutFilter" class="org.springframework.security.web.authentication.logout.LogoutFilter">
    <constructor-arg value="https://weblogin.asu.edu/cas/logout"/>
    <constructor-arg>
      <bean class= "org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler"/>
    </constructor-arg>
    <property name="filterProcessesUrl" value="https://<server>/j_spring_security_logout"/>
  </bean>

After updating these changes in two files, I am restarting the docker services: docker restart .

But, I get 500 server error which I'm unable to debug. Please find the screenshot below:

screencapture-mathcast-la-asu-edu-j-spring-cas-security-check-2021-12-28-05_32_31