Shibboleth SSO와 Discourse

안녕하세요,

드디어 Discourse 사이트에 Shibboleth 연동을 완료했습니다. 방법은 간단했습니다… 알아내면요 :joy:.

  1. 웹 서버 하나에서 Shibboleth가 작동하도록 설정하세요 (Discourse 서버와 같을 필요는 없습니다). 이를 shib.univ.edu라고 부르겠습니다.

  2. Discourse SSO를 수행하기 위해 shib.univ.edu에서 디렉토리를 하나 준비하세요. 이를 discourse-sso라고 부르겠습니다.

  3. Shibboleth를 사용하여 이 디렉토리를 보호하세요. Apache를 사용하는 경우, 보통 discourse-sso/.htaccess에 다음과 같은 내용을 추가하면 됩니다:

     # Shibboleth header
     AuthType Shibboleth
     ShibRequireSession On
     ShibApplicationId default
     ShibExportAssertion On
    
     require shib-user ~ ^.+@univ\.edu$
    
  4. 공식 Discourse SSO 가이드에 설명된 서명 작업을 수행하는 라이브러리를 하나 준비하세요. 저는 cviebrock/discourse-php를 사용합니다. 사용 설명서에서 복사한 sso.php를 여기에 생성하세요.

  5. username과 email은 환경 변수 eppn에 포함됩니다. 따라서 cviebrock/discourse-php(위 링크)에 설명된 사용 설명서를 따랐다면, 다음과 같이 설정하면 됩니다.

     // Insert your user authentication code here ...
     // Required and must be consistent with your application
     $userEmail = getenv( 'eppn' );
    
     // Required and must be unique to your application
     $userId = strstr( $userEmail, '@', true );
    
  6. 공식 Discourse SSO 가이드에서 SSO를 활성화하세요. sso url을 https://shib.univ.edu/discourse-sso/sso.php를 가리키도록 설정하면 됩니다.

GI

7개의 좋아요