[CAS] CAS Client 기초 설정 가이드 - PHP









http://www.ja-sig.org/downloads/cas-clients/php/










에서 최신버전

phpCAS

모듈을 내려받습니다

.













CAS-[


버전

]

디렉토리 밑에

CAS, docs

디렉토리와

CAS.php

파일을 해당

php

프로젝트 루트에 붙여넣습니다

.













include










페이지 수정
















해당 로직을

include

페이지 상단에 삽입합니다



.



(





서버 설정에 따라 붉은 볼드 부분은 변경될 수 있습니다

.)






















<?php


















//










// phpCAS simple client










//


















// import phpCAS lib










include_once('CAS.php');


















phpCAS::setDebug();


















// initialize phpCAS










phpCAS::client(CAS_VERSION_2_0,'sso-cas.univ-rennes1.fr',443,'');


















// no SSL validation for the CAS server










phpCAS::setNoCasServerValidation();


















// force CAS authentication










phpCAS::forceAuthentication();


















// at this step, the user has been authenticated by the CAS server










// and the user's login name can be read with phpCAS::getUser().


















// logout if desired










if (isset($_REQUEST['logout'])) {












phpCAS::logout();










}


















// for this test, simply print that the authentication was successfull










?>










Web Application


을 재 시작하여

CAS Login

페이지가 나오게 되면 정상입니다

.


참고자료:

http://www.ja-sig.org/wiki/display/CASC/phpCAS








댓글

가장 많이 본 글