<Nikita/Pawan> Fix for saml security vulnerability mentioned in this paper bit.ly/K2cIKt. Need a bit of refactoring, but this fix is good to go and secure