title: Getting SAML Request is invalid error while requesting into OpenAm from SP?
body: <p>We have an Enterprise App acting as SP (Service Provider) and an OpenAm acting as IDP (Identity Provider).</p>
  
  <p>Generated a metadata from SP and imported into OpenAm</p>
  
  <p><strong>Metadata file</strong> </p>
  
  <pre><code>&lt;md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"  ID="_602b5e40-99ef-0134-def1-4d6af9854785" entityID="https://&lt;site&gt;/sso_auth/metadata"&gt;
  &lt;md:SPSSODescriptor AuthnRequestsSigned="true" WantAssertionsSigned="true" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol"&gt;
  &lt;md:KeyDescriptor use="signing"&gt;
  &lt;ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt;
  &lt;ds:X509Data&gt;
  &lt;ds:X509Certificate&gt;
  cert
  &lt;/ds:X509Certificate&gt;
  &lt;/ds:X509Data&gt;
  &lt;/ds:KeyInfo&gt;
  &lt;/md:KeyDescriptor&gt;
  &lt;md:KeyDescriptor use="encryption"&gt;
  &lt;ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt;
  &lt;ds:X509Data&gt;
  &lt;ds:X509Certificate&gt;
  cert
  &lt;/ds:X509Certificate&gt;
  &lt;/ds:X509Data&gt;
  &lt;/ds:KeyInfo&gt;
  &lt;/md:KeyDescriptor&gt;
  &lt;md:SingleLogoutService ResponseLocation="https://&lt;site&gt;/sso_auth/logout" Location="https://&lt;site&gt;/sso_auth/logout" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"/&gt;
  &lt;md:NameIDFormat&gt;
  urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified
  &lt;/md:NameIDFormat&gt;
  &lt;md:AssertionConsumerService isDefault="true" index="0" Location="https://&lt;site&gt;/sso_auth/consume_saml" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"/&gt;
  &lt;/md:SPSSODescriptor&gt;
  &lt;/md:EntityDescriptor&gt;
  </code></pre>
  
  <p>SP digitally signs and initiate a request to OpenAm then I am getting <strong>'The SAML Request is invalid'</strong> error.</p>
  
  <p>Singed SP's Request</p>
  
  <pre><code>&lt;samlp:AuthnRequest AssertionConsumerServiceURL='https://&lt;site&gt;/sso_auth/consume_saml'
      Destination='http://&lt;openam&gt;/openam_12.0.0/SSOPOST/metaAlias/idp'
      ID='_2eeaae10-99f0-0134-def1-4d6af9854785' IssueInstant='2016-12-01T12:32:44Z' Version='2.0'
      xmlns:saml='urn:oasis:names:tc:SAML:2.0:assertion'
      xmlns:samlp='urn:oasis:names:tc:SAML:2.0:protocol'&gt;
      &lt;saml:Issuer&gt;https://&lt;site&gt;/sso_auth/metadata&lt;/saml:Issuer&gt;
      &lt;ds:Signature xmlns:ds='http://www.w3.org/2000/09/xmldsig#'&gt;
          &lt;ds:SignedInfo&gt;&lt;ds:CanonicalizationMethod Algorithm='http://www.w3.org/2001/10/xml-exc-c14n#'/&gt;&lt;ds:SignatureMethod Algorithm='XMLSecurity::Document::RSA_SHA1'/&gt;
              &lt;ds:Reference URI='#_2eeaae10-99f0-0134-def1-4d6af9854785'&gt;
                  &lt;ds:Transforms&gt;&lt;ds:Transform Algorithm='http://www.w3.org/2000/09/xmldsig#enveloped-signature'/&gt;
                      &lt;ds:Transform Algorithm='http://www.w3.org/2001/10/xml-exc-c14n#'&gt;&lt;ec:InclusiveNamespaces PrefixList='#default samlp saml ds xs xsi md'
                          xmlns:ec='http://www.w3.org/2001/10/xml-exc-c14n#'/&gt;&lt;/ds:Transform&gt;
                  &lt;/ds:Transforms&gt;&lt;ds:DigestMethod Algorithm='http://www.w3.org/2000/09/xmldsig#sha1'/&gt;
                  &lt;ds:DigestValue&gt;n4a4wAkD84V7Qm+8MTeYcJzsAxI=&lt;/ds:DigestValue&gt;
              &lt;/ds:Reference&gt;
          &lt;/ds:SignedInfo&gt;
          &lt;ds:SignatureValue&gt;
              signature
          &lt;/ds:SignatureValue&gt;
          &lt;ds:KeyInfo&gt;
              &lt;ds:X509Data&gt;
                  &lt;ds:X509Certificate&gt;
                      cert
                  &lt;/ds:X509Certificate&gt;
              &lt;/ds:X509Data&gt;
          &lt;/ds:KeyInfo&gt;
      &lt;/ds:Signature&gt;&lt;samlp:NameIDPolicy AllowCreate='true'
          Format='urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified'/&gt;&lt;/samlp:AuthnRequest&gt;
  </code></pre>
  
  <p>I am getting bellow error</p>
  
  <p><a href="https://i.stack.imgur.com/SsNEC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SsNEC.png" alt="enter image description here"></a></p>
  
  <p>Please help me to solve this issue </p>