Open paulproteus opened 8 years ago
1 correction, we request a v2 persistent nameId (see https://github.com/sandstorm-io/sandstorm/blob/ba4486cf12ad7780846c9b17b99611e563d96311/shell/packages/accounts-saml/saml_utils.js#L30). It's worth noting that IDPs can seemingly ignore this request, and actually return whatever format of nameId they desire.
Thanks @jparyani - I corrected this!
For what it's worth, the Shibboleth identity provider (a server that speaks SAML)
by default, the Shibboleth IdP creates the persistent ID proper by calculating the SHA-1 hash of the SP’s entity ID plus a user attribute value plus an admin-specified salt (i.e., the output is 20 bytes, Base64 encoded)
@jparyani says that Okta uses just an email address, which sure is simpler.
UPDATE: See also:
Shibboleth's approach seems to be pretty reasonable, honestly, although it's not an email address. Curious for @kentonv's +1/-1. The algorithm (take some stuff, then append a "salt", then hash it) seems not to be trivially length-extension-able, but it doesn't strike me as great. It hopefully does prevent enumeration, though, of valid identity IDs, and uses the salt as a kind of server namespace.
I've asked two educational SAML users to get back to me on how they configure this, for what it's worth.
If Shibboleth is baking the SP into the NameID, that's a problem -- it implies that two different Sandstorm servers will get different NameIDs, therefore grains will not be transferable between them.
Then presumably the best decision is:
urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
(aka SAML 2.0 persistent name identifier). (Presumably a quick change by @jparyani )An alternative is to carefully write Shibboleth-specific smarts, relying on https://wiki.shibboleth.net/confluence/display/IDP30/NameIDGenerationConfiguration#NameIDGenerationConfiguration-FormatSelectionFormatSelection , but I think that's a bad idea.
@kentonv if you're +1 on this, then I request you close this with a comment that says: +1
(or similar)
But... SAML's security is designed around authenticating a NameID, not around authenticating an email address. If we use email address as our primary ID, that means that we're putting a lot of faith in the email field to be accurate.
Possible problems:
So, I am -1 on using email address.
I would like to understand better what the configuration options are for administrators. Is it possibly easy for them to configure Shibboleth to use global IDs rather than SP-local ones? My quota for reading SAML documentation has run out for today.
All fair points. I will try find out the answer to your question.
Context
X-Sandstorm-User-Id
gets sent to that grain. Let's call this the "identity ID".(accountType, accountIdentifier)
(I've made up these terms, but I believe this is accurate).Design questions
accountIdentifier
be? Some options include:urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
(see e.g. StackOverflow discussion)Research to be done:
urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
(aka persistent name identifier), left to their own devices?urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
(aka persistent name identifier)? To answer this, I'll check the Internet2 login provider documentation.Other notes
(saml, 'asheesh@example1.edu')
owns a grain might not be precise enough. Example: Alice maintainssandstorm.example1.edu
and trustssaml.example1.edu
to assert email addresses. Alice enables federation tosandstorm.example2.edu
which decides to assert that Bob's email address is `asheesh@example1.edu'. I guess that's maybe not a huge problem if SAML admins 100% trust each other.NOTE: Thanks to @jparyani I edited this to say
urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
and persistent name ID, rather thanurn:oasis:names:tc:SAML:1.1:nameid-format:unspecified
and unspecified name ID.