You need to sign in to do that
Don't have an account?

POST to recipient url
Hi,
how do you post the saml assertion and the relaystate url to the recipient url? I've tried a bunch of methods but none of them seem to work because I don't even see error messages in the login history. So this means that it's not even getting my assertion properly never mind check the validity of it. Right now i'm just trying this:
<form name = "acsForm" action ="(recipient url that salesforce gives)" method = "post">
<input type = "hidden" name = "TARGET" value = https://na2.salesforce.com/home/home.jsp />
<input type = "hidden" name = "SAMLResponse" value = "(assertion that I came up with)" />
<input type = "submit" value = "Submit" />
</form>
I also tried replacing TARGET with RelayState and replacing SAMLResponse with SAMLart. None of them seem to work. When I use SAMLResponse, I actually get a general error message initially in the screen. When I use SAMLart, I just go to the page where it prompts me for my salesforce username and password. Both however, don't show any error messages in the login history. PLEASE HELP ME.
Thanks in advance.
thanks
Jong Lee
Salesforce.com
<samlp:Response
xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol"
MajorVersion="1" MinorVersion="1"
ResponseID="<RESPONSE_ID>"
IssueInstant="<ISSUE_INSTANT>">
<samlp:Status>
<samlp:StatusCode Value="samlp:Success"/>
</samlp:Status>
<saml:Assertion
xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"
MajorVersion="1" MinorVersion="1"
AssertionID="<ASSERTION_ID>"
Issuer="Shyam"
IssueInstant="<ISSUE_INSTANT>">
<saml:Conditions
NotBefore="<NOT_BEFORE>"
NotOnOrAfter="<NOT_ON_OR_AFTER>"/>
<saml:AuthenticationStatement
AuhenticationMethod="urn:oasis:names:tc:SAML:1.0:am:Password"
AuthenticationInstant="<AUTHN_INSTANT>">
<saml:AttributeStatement>
<saml:Subject>
<saml:NameIdentifier>
<USERNAME_STRING>
</saml:NameIdentifier>
<saml:SubjectConfirmation>
<saml:ConfirmationMethod>
urn:oasis:names:tc:SAML:1.0:cm:bearer
</saml:ConfirmationMethod>
<saml:SubjectConfirmationData
Recipient="<ACS_URL>"
NotOnOrAfter="<NOT_ON_OR_AFTER>"/>
</saml:SubjectConfirmation>
</saml:Subject>
</saml:AttributeStatement>
</saml:AuthenticationStatement>
</saml:Assertion>
</samlp:Response>
<Response xmlns="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" IssueInstant="2008-07-10T18:18:23.108Z" MajorVersion="1" MinorVersion="1" Recipient="http://localhost:9000" ResponseID="_5f8235795b782d060b68b2b13e7750a61215713903161"><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></ds:CanonicalizationMethod>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></ds:SignatureMethod>
<ds:Reference URI="#_5f8235795b782d060b68b2b13e7750a61215713903161">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></ds:Transform>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="code ds kind rw saml samlp typens #default xsd xsi"></ec:InclusiveNamespaces></ds:Transform>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:DigestMethod>
<ds:DigestValue>bp0aZGMoSvQ4rGHLkUzmBcat7fo=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>
eIB3i+dEPbUcLab02kPM3PkRL85qAOKzQFcL5xofhLopCDA+uLpGCN+lnEGp3th3YX443GG+ib+H
QwWpb3ynLsyDQBfVpCygHCSguvcZ1KqTri/PAevMNG+XuKOFn72/IbohGVH762A4d8Le7v1topwz
KCY9BdiFdEoWVAtPstM=
</ds:SignatureValue>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>
MIICZzCCAdCgAwIBAgIGARg99vNTMA0GCSqGSIb3DQEBBAUAMHcxEjAQBgNVBAMMCVNBTUwgVGVz
dDENMAsGA1UECwwEUEFDUzEXMBUGA1UECgwOU2FsZXNmb3JjZS5jb20xFjAUBgNVBAcMDVNhbiBG
cmFuY2lzY28xEzARBgNVBAgMCkNhbGlmb3JuaWExDDAKBgNVBAYTA1VTQTAeFw0wODAyMjEyMTQ3
MTdaFw0wOTAyMjAyMTQ3MTdaMHcxEjAQBgNVBAMMCVNBTUwgVGVzdDENMAsGA1UECwwEUEFDUzEX
MBUGA1UECgwOU2FsZXNmb3JjZS5jb20xFjAUBgNVBAcMDVNhbiBGcmFuY2lzY28xEzARBgNVBAgM
CkNhbGlmb3JuaWExDDAKBgNVBAYTA1VTQTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAhw+z
f1riAlFcvVLTa5+8yqEv0Hvr98MSpWDdbs8BAaNtZMvlQoJCrWCuZdCeJp02np7uSQaOSrdxbrOk
TVRC94RZz6rUrl2rWEooiDHNtjvECvCpYM3BmSZSYUUFTmir9IViqHrF1CkmZNfGbH4FMA7jF72f
j32m5LWyipRuj/cCAwEAATANBgkqhkiG9w0BAQQFAAOBgQBgeLTGZjaFldknvXEChQ3Qc6H0uYW5
7LSZMav7I9Lf8PzODm7Dz7tA/yQAjjQFSWl8WeBnRbP3q/DTu63tc30EPy9PnczQ3Knzjxm5FAzJ
9W565xDhl6YY2Wi1Qn3DhksfQZjPFab8CbzoXb3xckGHTvWljeeZiQ1oHKX8XiLdlQ==
</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo></ds:Signature><Status><StatusCode Value="samlp:Success"></StatusCode></Status><Assertion xmlns="urn:oasis:names:tc:SAML:1.0:assertion" AssertionID="_43274672d5a9320b3282f27f968f4eba1215713903117" IssueInstant="2008-07-10T18:18:23.108Z" Issuer="https://www.salesforce.com" MajorVersion="1" MinorVersion="1"><Conditions NotBefore="2008-07-10T18:18:23.108Z" NotOnOrAfter="2008-07-10T18:23:23.108Z"><AudienceRestrictionCondition><Audience>https://saml.salesforce.com</Audience></AudienceRestrictionCondition></Conditions><AuthenticationStatement AuthenticationInstant="2008-07-10T18:18:23.161Z" AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:password"><Subject><NameIdentifier>foobar@salesforce.com</NameIdentifier><SubjectConfirmation><ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:bearer</ConfirmationMethod></SubjectConfirmation></Subject></AuthenticationStatement></Assertion></Response>
Jong
See my example where if you use username in the subject mapping, AttributeStatement is optional.
thanks
Jong
<Response xmlns="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"
xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" IssueInstant="2008-07-10T18:42:44.284Z" MajorVersion="1"
MinorVersion="1" Recipient="http://localhost:9000"
ResponseID="_6ccb8357de3c905349ca14e42d9bf97d1215715364285">
<Status>
<StatusCode Value="samlp:Success"></StatusCode>
</Status>
<Assertion xmlns="urn:oasis:names:tc:SAML:1.0:assertion"
AssertionID="_818891251f47ba13b15f600c301749df1215715364284" IssueInstant="2008-07-10T18:42:44.284Z"
Issuer="https://www.salesforce.com" MajorVersion="1" MinorVersion="1">
<Conditions NotBefore="2008-07-10T18:42:44.284Z" NotOnOrAfter="2008-07-10T18:47:44.284Z">
<AudienceRestrictionCondition>
<Audience>https://saml.salesforce.com</Audience>
</AudienceRestrictionCondition>
</Conditions>
<AuthenticationStatement AuthenticationInstant="2008-07-10T18:42:44.284Z"
AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:password">
<Subject>
<NameIdentifier>who cares</NameIdentifier>
<SubjectConfirmation>
<ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:bearer</ConfirmationMethod>
</SubjectConfirmation>
</Subject>
</AuthenticationStatement>
<AttributeStatement>
<Subject>
<NameIdentifier>who cares</NameIdentifier>
<SubjectConfirmation>
<ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:bearer</ConfirmationMethod>
</SubjectConfirmation>
</Subject>
<Attribute AttributeName="SFDC_SUBJECT_ATTR" AttributeNamespace="SFDC_SUBJECT_ATTR_URI">
<AttributeValue>foobar</AttributeValue>
</Attribute>
</AttributeStatement>
</Assertion>
</Response>
thanks
Jong Lee
Salesforce.com
I was able to make a case in my salesforce account but I'm not too sure if i did it correctly...anyway here is the base64 encoded SAML response. The signature is actually invalid but still it should say signature invalid and not assertion invalid in the login history.
Thanks.
</saml:Assertion></samlp:Response> � H�\�
So please make sure you encode the base64 properly.
a) the xmlResponse contains bad characters then translated into garbage data after doing base64
not likely but possible
b) some cut/paste issue here, most likely
Anyway, I went ahead and hand modified your sample, removed the garbage data and fixed up the SignatureValue
and X509Certificate data(since you removed some data and put "..." and our parser complains they are not valid
base64Binary).
Then the real problem is in the AuthenticationStatement, where you have "AuhenticationMethod" attribute -- notice the typo there.
code snippet:
SObject[] objs = connection.retrieve(SSOID_FIELD, "User", new String[]{userid});
((User) objs[0]).setFederationIdentifier(samlSubject);
SaveResult[] result = connection.update(new SObject[]{objs[0]});
If you are using username as the subject, it must be your SFDC username, which does not have to be xxx@salesforce.com, it should work if v.shyam121@gmail.com is the actual SFDC username.
Subject confirmation error indicates the SubjectConfimration is not "urn:oasis:names:tc:SAML:1.0:cm:bearer".
thanks
Jong Lee
Salesforce.com