initial attempt to make this more robust and conform to simple saml rules