auth0/node-samlp

"http://office.google.com" post linkin test example

snunit opened this issue · 1 comments

Hi,
I'm using this module, in order to implement Identity Provider, the test example is very good for clarifications, but I still didn't understand what is the "http://office.google.com" used for?
What is the meaning of this address? Should I replace it, and with which link?
if I leave it as is, I got the following message when trying to reach the file in drive: "Unable to resolve the server's DNS address."

Thanks,
Miriam.

Miriam,

The 'http://office.google.com' is the POST url that your IdP will POST to with the SAML token. (http://en.wikipedia.org/wiki/SAML_2.0#SP_POST_Request.3B_IdP_POST_Response)

The function getPostUrl is really only used when your IdP will provide a SSO for more than one SP. If your IdP is only providing SSO for something like salesforce or Jive. You'll replace that url in the callback to your SP's SSO url.
Example for Jive:

var getPostUrl = function (audience, samlRequestDom, req, callback) {
  callback(null, 'https://my-jive-instance.com/saml/sso');
};

However, if your IdP will be providing SAML SSO for more than one SP you would use the 'getPostUrl' function to verify the samlRequest & initial request and then use the 'audience' parameter to determine the correct url to post your SAML token. Take a look here: https://github.com/auth0/node-samlp/blob/master/lib/samlp.js#L182 to see how the 'getPostUrl' function is called from the samlp source code. So, for example, if you were providing SAML SSO for both Jive and Salesforce your code MIGHT look something like this (this block has not been executed nor verified, it is an example only)

var getPostUrl = function (audience, samlRequestDom, req, callback) {
  if (audience === 'jive'){
    callback(null, 'https://my-jive-instance.com/saml/sso');
  }
  else if (audience === 'salesforce'){
    callback(null, 'https://my-salesforce-instance.com/saml/sso');
  }
  else {
    unknownAudience = new Error('unknown audience');
    callback(unknownAudience, null);
  }
};