Issue #7622 by tj, changed to other repos. Better SAML2 support