概要 †
検証目的のSPとして、SimpleSAMLphpを構築します。
仮想マシンよりも手軽なので今回はAzure App Serviceにデプロイします。
セキュリティに関わる事項は、この記事の範疇外です。
Azure App Serviceへの手軽なデプロイ方法として、ローカルgit, ftpsがありますが、gitの恩恵に預かりたいのでgitで進めます。
ただしSimpleSAMLphpのリポジトリからのインストールは、環境整備の手間がかかるので、パッケージされたデータをソースとして使います。
手順(Azure) †
- 新規App Service作成(Freeプランで可能)
- [デプロイオプション]で[ローカルGitリポジトリ]を選択
- [デプロイ資格情報]設定(リソース間で共通なので、今まで設定したことがあれば不要)
- [アプリケーション設定]仮想アプリケーションとディレクトリ
仮想ディレクトリ | 物理パス | アプリケーション? |
/ | site\wwwroot\www | アプリケーション |
/simplesaml | site\wwwroot\www | アプリケーション |
- [概要]で[Git クローン URL]を控える
手順(SimpleSAMLphp) †
- ソース取得
1
2
3
4
|
| wget https://github.com/simplesamlphp/simplesamlphp/releases/download/v1.14.14/simplesamlphp-1.14.14.tar.gz
tar zxf simplesamlphp-1.14.14.tar.gz
mv simplesamlphp-1.14.14 sp1
cd sp1
|
- gitリポジトリ作成
1
2
3
4
|
| git init
git add .
git commit -a -m "init"
git remote add azure <上で控えた[Git クローン URL]>
|
- vi config/config.php
1
2
| -
!
| 'auth.adminpassword' => '<adminパスワード>',
|
- 署名,暗号化用自己証明書作成
1
|
| openssl req -newkey rsa:2048 -new -x509 -days 3652 -nodes -subj "/C=JP/ST=Tokyo/CN=sp1" -out cert/sp1.crt -keyout cert/sp1.key
|
- vi config/authsources.php
1
2
3
4
5
|
-
!
| 'default-sp' => array(
'saml:SP',
'privatekey' => 'sp1.key',
'certificate' => 'sp1.crt',
|
- デプロイ
1
2
3
|
| git add .
git commit -a -m "Test SP setting"
git push azure master
|
確認 †
- デプロイ左記のURIをブラウザで開く
- [Federation]ページから、SPのメタデータが見えることなどを確認する
検証時の環境 †
- サーバー
- Azure App Service
- PHP 5.6
- SimpleSAMLphp 1.14.14
- 作業端末
参考 †