1
我的主域名是example.com
,我有子域test.example.com
和best.example.com
。如何在我的所有子域中實現單點登錄?
我想在我的所有子域中共享用戶身份驗證Cookie ,所有用戶將從login.example.com
登錄,任何用戶登錄都將重定向到此登錄域。
我的主域名是example.com
,我有子域test.example.com
和best.example.com
。如何在我的所有子域中實現單點登錄?
我想在我的所有子域中共享用戶身份驗證Cookie ,所有用戶將從login.example.com
登錄,任何用戶登錄都將重定向到此登錄域。
使用python默認的AuthTktAuthenticationPolicy和ACLAuthorizationPolicy。在金字塔AuthTktAuthenticationPolicy中,您必須提供一個密鑰,對於所有子域,您的sceret密鑰將相同,並且您在AuthTktAuthenticationPolicy中給出 parent_domain = True,那麼如果您在login.example.com中登錄,則會自動登錄到其他子域。
init.py
authn_policy=AuthTktAuthenticationPolicy('seekrit',hashalg='sha512',
parent_domain=True)
authz_policy = ACLAuthorizationPolicy()
良好的工作 - 非常有用! –