FreeIPA/Kerberos? ???? ?? ??? ?? ???? ???? SSO? ????? ???. ??? ? ??? ?? ??? ?? ????.
??? ?????? ? ?? ??? ???? ????.
Kinit, Unix ??? ? Apache Kerberos ??? ?????. ????? ???? Firefox ????? ???? ??(Kerberos ?? ??) FreeIPA WebConfig? ???? ? ????. ?? ? ??? ???? ???? ??? ????. ???? ??? ???? ?? ???? ?? LDAP ???? ???? ????. ??? ????? ?? ???? ?? ???? ??? FreeIPA ??? ???? ? ????. ??? ??? ????? ????? Kerberos ?? ??? ????? ??? ? ?? ???? ????.
??? ???? ?? ???? ?? ????? ????.
??? ????? ?? ??:
?????? ? ???? ? ??? ????.
?? ??????.
???:
? ?? VM? ????? VM ?? "ipa-client-install"? ?? ??????. ?? ? ???? Apache ???(ipa service-add HTTP/ebook.exampletest.de)? ???? ????.
??? ???? ?? ??? ?????.
???? ??? ?????? ??? ??? ?? ??? ?? ? ???(client(自己的票)
> web 服務(wù)(自己的票) > ipa server
). ??? ??? Apache ??? ? ldap/kerberos ??? ??? ???? ????. ??? ??? ??? ?? ??? ?? ???? ? ??? ???? ?? ??? ?????
??: <?php print_r($_SERVER) ?>
(????)
<?php $username = $_SERVER['PHP_AUTH_USER']; $password = 'password'; $ldap_rdn = 'uid='.$username.',cn=users,cn=accounts,dc=exampletest,dc=de'; $ldap_server = ldap_connect('ldap://ipa.exampletest.de:389'); ldap_set_option($ldap_server, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option($ldap_server, LDAP_OPT_REFERRALS, 0); if ($ldap_server) { $ldap_bind = @ldap_bind($ldap_server, $ldap_rdn, $password); if ($ldap_bind) { $search = array("uid","givenname","sn","mail","uidnumber","gidnumber"); $result = ldap_search($ldap_server, $ldap_rdn, "mail=$username*", $search); $info = ldap_get_entries($ldap_server, $result); print_r($info); } } ?>
? ??? ??? Kerberos ??? ??? ?????.
????? Kerberos ??? "??" ??? ???? ?? ??? ?? ???? ??? ??? ?????. ?????? ? ?? ???? HTTP/webapp.example.tld
? ?? ??? ?? ? ??? ??? ???? ???? LDAP? ????? ? ??? ?? ????.
???? ???? LDAP? ????? ?? ??? ?? ? ?? ??? ????.
? ??????? ?? LDAP ???? ?? ??? ?? ? ????. ??? ??? ?? ?? ??? ????. ? ??????? ???? ?? ?? ??? ???? ?? ???? ??? ?? Kerberos(SASL) ???? ??? ? ????.
LDAP? ? ??????? ?? ?? ??? ???? ???? "??"? ????? ?? "?? ID"(authzid)? ???? ??? ??? ???? ??? ?????.
?? ??, "webapp"?? ????? authzid "myuser"? ???? ??(??? LDAP ??? ?? ???? ?? ) "webapp"? ?? "myuser"? ????? ?? ??? ?? ???. .
? ??????? ?? HTTP ??(SPNEGO) ??? "??"? ???? ? ????. ?? ? ??? ??? ? ??? krbtgt
??? ?? ?? ?? ?? ??? ???? ? ?? ???? ???? ??? ? ??? ???.
??? ???? ? ?? ??? ????.
?? ??? ?? ?????? "??" ???? ???? ? krbtgt
??? ???? ?? ???(?: ??? ?? ??? ??? ?? ??? ??? ? ?? ??) ?? HTTP ?? ??? ?????. "??" ??).
? ??????? ????? ?? ???(??? ??)? ?? ????? ??? ????? ? ??????? ???? ??? ???. ? ?????? ??? ?? ???? ?? ??? ?????? ??? ??? ?? ??? ? ????.
Kerberos(ldap_sasl_bind() ??)? ???? ???? API? KRB5CCNAME
?? ??? ?? ??? ??? ??? ?????. ??? ?? ??? ???? ????? PHP? ??? ????? ???? ???(?? ? ?? ?? mod_php? ???? Apache ???? ??? ? ??????? ???? ??) ?? ?? ???? ??? ? ????.
AD??? AD? ?? ??? ???? ??? ?? ????? "??? ??"??? ???.
? ??????? S4U2Proxy(?? "??? ??")? ???? ???? ???? ?? ??? ??? ??? ?? ??? ??? ? ????(?: FreeIPA? ???? ldap/foo.example.com
??? ??? ? ????).
??? ?? ????(PHP?? ?? ?? API? ????. ??? ???? ???? ???? ? ?? ???? kinit
) ??? KRB5CCNAME ?? ?? ??? ??? ???? ??? ????.
?? Kerberos ??? ?? ???? ??? ????.
?????? ???. GSSAPI SASL ????? ??? ?? ?? ??? Kerberos ??? ?? ??? ????(?: $KRB5CCNAME ?? gss-proxy? ??) ???? ??? ??? ???? ?????.
??? ?????(LDAP ??? ???? ??? ??) authz_id? ???? ???:
???????? ldap_*()
PHP ??? C libldap ?????? ?? ????? ?? ??? ?? ??? ??? ? ????.
??? ???? ?? ???? ??? DN? ???? ???? mail
進(jìn)行額外過濾 - 只需在讀取郵件時使用 objectClass=*
?? DN? ??? ??? ?? ? ????. ?? ?? DN? ???? ?? ?? ????? "??" ??? ?? ldap_read()? ?????.
???, ?? ?? ???? ?????. ??? ??? ??(?: ????? Kerberos ??)? ????? ??? ????? ? ??? IPA? ??? ?? ?? ??? ??? ? ?? ?? ? ? ????.