add SSO support, thanks James Potter