
Windows AD 上に LAMP サーバーを立ち上げて、パススルー認証を機能させようとしています。1 つの問題 (これは私が言っているほど大きな問題ではないかもしれませんが) は、ホスト名とホストされた URL が一致しないということです。LAMP ホスト名はintranethost.mspca.org
、ホストされた URL はhttps://testintranet.mspca.org
AD はフォレスト/ドメイン レベル 2012R2 です。
LAMP は、Apache とともに mod_auth_gssapi がインストールされた Debian 11.8 です。LAMP には Samba がインストールされておらず、AD ドメインのメンバーでもありません (それが必要なのかどうかはわかりませんでした)。
次のように Windows DC からキースパン ファイルを作成しました。
ktpass -princ HTTPS/[email protected] -mapuser [email protected] -pass ******** -ptype KRB5_NT_PRINCIPAL -out testintranet-spn.keytab
私のレルムは krb5.cnf に正しく追加され、LAMP からの kinit は問題なく通過しました。
Apache conf(チュートリアルに基づく)https://www.jfcarter.net/%7Ejimc/documents/bugfix/41-auth-kerb.html):
<IfModule !mod_auth_gssapi.c>
LoadModule auth_gssapi_module /usr/lib64/httpd/modules/mod_auth_gssapi.so
</IfModule>
<VirtualHost *:80>
ServerName testintranet.mspca.org
# Redirect permanent / https://testintranet.mspca.org/
</VirtualHost>
<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/ssl/certs/star_mspca_org.crt
SSLCertificateKeyFile /etc/ssl/private/star_mspca_org.key
ServerAdmin [email protected]
ServerName testintranet.mspca.org
DocumentRoot /var/www/html/wordpress/
<Directory "/var/www/html/wordpress/">
AllowOverride All
AuthType GSSAPI
AuthName "GSSAPI Single Sign On Login"
GssapiSSLonly On
GssapiAllowedMech krb5
GssapiBasicAuth On
GssapiCredStore keytab:/etc/apache2/testintranet-spn.keytab
GssapiLocalName On
BrowserMatch Windows gssapi-no-negotiate
Require valid-user
GssapiNegotiateOnce on
</Directory>
ErrorLog ${APACHE_LOG_DIR}/wordpress.error.log
CustomLog ${APACHE_LOG_DIR}/wordpress.access.log combined
LogLevel info auth_gssapi:debug ssl:warn
</VirtualHost>
認証自体は実際に機能していますが、サイトの初期ログインプロンプトがまだ表示されます。現在ログインしている認証情報はセッションに引き継がれません。イントラネットセキュリティレベルページのGPOにサイトのすべての組み合わせ(http/s、短縮名、FQDN)を追加しましたが、Chromeは依然として頑固にログインダイアログを表示します。Apacheログの「エラー」だけが常に役立つものです。NO AUTH DATA Client did not send any authentication headers
OFFにするとGssapiBasicAuth
ダイアログは消えますが、すぐに401 Unauthorizedが表示されるので、試みるヘッダーを渡すには...
助言がありますか?
答え1
この小さな男:
BrowserMatch Windows gssapi-no-negotiate
誓って、私は見た複数のサイト「この行がないと、Windows クライアントは動作しません...」
私はその線を引いた外今では期待どおりに 100% 動作します。認証は、現在ログインしている Windows ユーザーから (Chrome 経由で FQDN 内部ホストに) 正常に渡されます。
将来、Google 検索で誰かがここにたどり着いた場合に備えて...