添付ファイル |
---|
...
tiqrshib20130329.tar.gzを利用したtiqrshibのインストールについて。
以下では、Shibboleth IdP(ID、パスワード認証)が動作している環境へのインストール手順として記述しています。
...
- Shibboleth SPをインストール、設定
- TiqrShibを配置(CDのtarTiqrShibを配置(tar.gzの解凍)
- 関連ライブラリを配置
- ライブラリのバグ修正
- Apacheの設定
- ShibbolethへのTiqrShibハンドラー設定
- TiqrShibの初期値設定
...
Tiqr登録時のID,パスワード認証用。IdPでは、フェデレーションとは別の、単独のメタデータとしてインストールしたSPのメタデータを設定。インストールしたSPには、このIdPのメタデータのみを設定。
2. TiqrShibを配置
CDのtartiqrshib20130329.tar.gzを解凍して、
解凍ディレクトリ内のtiqrzenddemoを/var/tiqrzenddemo に配置。
解凍ディレクトリ内のvar/www/html/TiqrShibを/var/www/html/TiqrShibに配置(trans.phpの配置)。
解凍ディレクトリ内のvar/www/html/tiqrenroll/index.htmlを/var/www/html/tiqrenrollに配置(index.htmlの配置)
上記で配置したindex.html内のサーバFQDNを修正します。 (下記の(IdPサーバFQDN)部分)
...
アプリケーション | バージョン | ダウンロードサイト | ||
---|---|---|---|---|
Tiqr-library | 1.0.0 | |||
Tiqr-zendframework | 1.0.0 | |||
ZendFramework | 1.12.2-minimal | |||
phpqrcode | 1.1.4 |
| (*) 実行にphp-gdが必要です。 |
コード ブロック |
---|
mkdir /var/ |
コード ブロック |
mkdir /var/www/library
cp -rf tiqr-server-library-1.0.0/library/tiqr /var/www/library/libTiqr
cp -rf tiqr-server-zendframework-1.0.0/library/tiqr-zf /var/www/library/tiqr-zf
cp -rf phpqrcode /var/www/library/phpqrcode
ZendFramework-1.12.1-minimalを/usr/shareに展開して、
ln -s ZendFramework-1.12.1-minimal ZendFramework
|
【ライブラリ リンク作成】=>作業報告書P24
(*) 上記はリンクでなく、直接でもよいです。
【library設定】=>作業報告書P21
4. ライブラリのバグ修正
【ZendFramework修正】=>作業報告書P23
下記リンクを確認。 リンクされてない場合は、リンクを作成。
コード ブロック |
---|
ln -s /var/www/library/libTiqr /var/tiqrzenddemo/library/tiqr
ln -s /var/www/library/phpqrcode /var/tiqrzenddemo/library/phpqrcode
ln -s /var/www/library/tiqr-zf /var/tiqrzenddemo/library/tiqr-zf
ln -s /usr/share/ZendFramework /var/tiqrzenddemo/library/zend
|
(*) 上記はリンクでなく、直接配置しても良い。
直接配置する場合は、/var/tiqrzenddemo/library/の下に配置して、/var/tiqrzenddemo/public/index.phpの修正(下記)が必要。
コード ブロック |
---|
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library/zend/library'),
realpath(APPLICATION_PATH . '/../library/tiqr'),
realpath(APPLICATION_PATH . '/../library/tiqr-zf'),
realpath(APPLICATION_PATH . '/../library/libTiqrShib'),
get_include_path(),
)));
|
【library設定】
/etc/php.iniに下記を追加。
コード ブロック |
---|
include_path = ".:/usr/share/ZendFramework/library:/var/www/library/libTiqr"
|
4. ライブラリのバグ修正
【ZendFramework修正】=>作業報告書P23
/usr/share/ZendFramework/library/Zend/View/Helper/Placeholder/Container/Abstract/usr/share/ZendFramework/library/Zend/View/Helper/Placeholder/Container/Abstract.php に以下を追記
コード ブロック |
---|
/** * Sort the array by key * * @return array */ public function ksort() { $items = $this->getArrayCopy(); return ksort($items); } |
...
/var/tiqrzenddemo/application/configs/application.ini 修正および追記(28ページ:提供コードで修正済)
・修正箇所 ・修正箇所 (実際の修正時には、コメント行= "#"の付いた行は、エラーとなるので削除してください。)
コード ブロック |
---|
# resources.tiqr.identifier = "zeus.local" resources.tiqr.identifier = "vm2.peofiamp.nii.ac.jp" # resources.tiqr.name = "Zeus" resources.tiqr.name = "vm2" # resources.tiqr.auth.protocol = "surfauth" resources.tiqr.auth.protocol = "tiqrauth" # resources.tiqr.logoUrl = "http://zeus.local/img/surfmedia-logo.png" resources.tiqr.logoUrl = "https://vm2.peofiamp.nii.ac.jp/icons/GakuNin_logo.png" # resources.tiqr.session.secret = "enter something truly random here, preferably generated using openssl" resources.tiqr.session.secret = "0124567abcdefgh" |
...
コード ブロック |
---|
# (resources.tiqr.userstorage.path = "/tmp" 以下に追記) resources.tiqr.ocra.suite = "OCRA-1:HOTP-SHA1-6:QH10" resources.log.stream.writerName = "Stream" resources.log.stream.writerParams.stream = APPLICATION_PATH "/logs/application_" DATESTAMP ".log" resources.log.stream.writerParams.mode = "a" resources.log.stream.filterName = "Priority" resources.log.stream.filterParams.priority = 7 resources.log.stream.filterParams.priority = 7 |
/var/tiqrzenddemo/application/modules/v1/views/scripts/login/index.phtml 修正(29ページ)
コード ブロック |
---|
# $this->headScript()->prependFile($this->baseURL().'/scripts/jquery.js')
$this->headScript()->prependFile($this->baseUrl().'/scripts/jquery.js')
|
/var/tiqrzenddemo/applicationlibrary/modulestiqr-zf/v1Tiqr/viewsController/scriptsEnroll/login/index.phtml 修正(29ページ)Abstract.php 修正(30ページ)
コード ブロック |
---|
# $this->headScript()->prependFile($this->baseURL().'/scripts/jquery.js') $this->headScript()->prependFile($this->baseUrl().'/scripts/jquery.js') >view->enrollmentURL = $this->_getTiqr()->generateEnrollmentURL($metadataURL); $this->view->enrollmentURL = $metadataURL; |
/var/tiqrzenddemo/library/tiqr-zf/Tiqr/Controller/EnrollLogin/Abstract.php 修正(30ページ)修正
コード ブロック |
---|
# $this->view->enrollmentURL =//$secret = pack('H*', $this->_getTiqrgetUserSecret($userId)->generateEnrollmentURL($metadataURL); $this->view->enrollmentURL$secret = $metadataURL$this->_getUserSecret($userId); |
5. Apacheの設定
<httpd.conf>
追記:
...
コード ブロック |
---|
<?php class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { // retrieve tiqrshib constants protected function _initConstants() { $options = $this->getOption('constants'); if (is_array($options)) { foreach($options as $key => $value) { if(!defined($key)) { define($key, $value); } } } } protected function _initLogger() { $this->bootstrap("log"); $logger = $this->getResource("log"); Zend_Registry::set("logger", $logger); } } |
(*) CDのtiqrshibコードには、ログ出力コードを入れているため、
上記のLogger設定も必要。tiqrshib20130329.tar.gz内のtiqrshibコードには、ログ出力コードを入れているため、上記のLogger設定も必要。
【Tiqr初期値設定】(作業報告書P33)
/var/tiqrzenddemo/application/config/application.iniの設定を修正。
コード ブロック |
---|
resources.tiqr.identifier = "vm2.peofiamp.nii.ac.jp" ↑サーバのFQDNを記入。 resources.tiqr.name = "vm2" ↑Tiqrサーバの名称(アプリ上に表示される)を記入。 resources.tiqr.logoUrl = "https://vm2.peofiamp.nii.ac.jp.nec.testjp/icons/gakunin-logo.png" ↑アプリに表示するロゴを指定。5KBくらいのpngファイル。100KBくらいだとアプリへのロードに時間が掛る。 constants.TIQRSHIB_DOMAIN = "necnii.ac.testjp" ↑IdPが送るeppnのセキュリティドメイン ↓以下のLDAP設定には、attribute-resolver.xmlと同じものを設定。 constants.TIQRSHIB_LDAP_HOST = "localhost" constants.TIQRSHIB_LDAP_PORT = "389" constants.TIQRSHIB_LDAP_BASEDN = "o=test_o,dc=ac,c=JP" constants.TIQRSHIB_LDAP_BINDREQUIRESDN = "true" constants.TIQRSHIB_LDAP_USERNAME = "cn=Manager,o=test_o,dc=ac,c=JP" constants.TIQRSHIB_LDAP_PASSWORD = "password" |
(*) LDAPの検索では、"uid"をフィルタとして検索しています。
uidと異なる属性名を利用している場合は、/var/tiqrzenddemo/library/libTiqrShib/tiqrShibLdap.phpの
$result = $ldap->search('(uid='.$userId.')');
の行(2か所)にて、"uid"を修正して下さい。