Use settings:PrivateKey

Change ENV['SAML_PRIVATE_KEY'] to use settings[:spPrivateKey]