LoginSignup
2
3

More than 3 years have passed since last update.

mod_auth_openidcをビルドから試す

Last updated at Posted at 2015-12-19

mod_auth_openidcをビルドから試す

はじめに

OpenID ConnectのRelying PartyをApacheモジュールでやってくれる実装のmod_auth_openidcを取ってきてビルドして使いたいけどビルドできなくて困ってる人のための記事

環境

AWSのAmazon Linuxのt2.micro

ソフトウェア バージョン
Apache 2.2
mod_auth_openidc 1.8.6
jansson 2.7

インストール

始めるために必要なもの一式install

Apacheモジュールのビルドなのでhttpd-develを始め、いろいろdevelでのインストールが必要。

yum -y install git httpd-devel mod_ssl automake libcurl-devel openssl-devel libtool pcre-devel

janssonというCでJSONをParseするためのライブラリは手で入れる必要アリ。

git clone https://github.com/akheron/jansson.git
cd jansson/
libtoolize -c
autoreconf -i
./configure
make
make install

mod_auth_openidcのインストール。

注意すべき点としては、janssonにパス通ってないと思うので通すの忘れないこと。

cd ..
git clone https://github.com/pingidentity/mod_auth_openidc.git
cd mod_auth_openidc/
autoreconf
export PKG_CONFIG_PATH=PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
./configure
make
make install

後はRPのための設定。

今回はサンプルとしてgoogleを指定

/etc/httpd/conf.d/rp.conf
LoadModule auth_openidc_module modules/mod_auth_openidc.so

OIDCProviderMetadataURL https://accounts.google.com/.well-known/openid-configuration
OIDCClientID YOUR_CLIENT_ID
OIDCClientSecret YOUR_CLIENT_SECRET

OIDCRedirectURI https://YOUR_DOMAIN/test/cb
OIDCCryptoPassphrase YOUR_PASS_PHRASE

<Location /test>
   AuthType openid-connect
   Require valid-user
</Location>

Locationのパス以下にRedirect URIを指定すれば、コンテンツが無くてもモジュールがキャッチしてくれる。

まとめ

ざっくりしたメモとして残しているだけなので、手順に不足等あったらお教えくださいませ。

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3