{"id":9238,"date":"2022-08-12T11:08:27","date_gmt":"2022-08-12T16:08:27","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=9238"},"modified":"2022-08-12T11:08:27","modified_gmt":"2022-08-12T16:08:27","slug":"on-federated-identity-providers","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=9238","title":{"rendered":"On Federated Identity Providers"},"content":{"rendered":"<p>The basic idea here is that you may want someone to be able to validate your users without actually having access to your passwords or directory data. As a counter-example, a company I work with has their payroll &#8220;stuff&#8221; outsourced. Doing so required a B2B VPN that allowed the hosting company to access an internal LDAP directory. I set up an access control list for their connection so they could only authenticate users. Someone at the hosting company couldn&#8217;t download all of the e-mail addresses or phone numbers. Even so, a sufficiently motivated employee of the third-party company <em>could<\/em> get the logon and password for anyone who used their server \u2013 if it&#8217;s my code, adding the equivalent of &#8216;fileHandle.write(f&#8221;u:{username} p:{password}&#8221;)&#8217; would write a log file with every cred used on the site.<\/p>\n<p>Don&#8217;t contract with dodgy companies that are going to drop your user creds out to a file and do malicious stuff is a good start, but I would concede that &#8220;avoid dodgy companies&#8221; isn&#8217;t a great security paradigm.\u00a0 Someone came up with this &#8220;federated identity&#8221; methodology &#8212; instead of <em>you<\/em> asking the user for their ID and password, you get a URL to redirect not-yet-logged-on users over to someone trusted to handle passwords. This is the &#8220;identify provider&#8221;, or IDP.<\/p>\n<p>I access your website (called the &#8216;service provider&#8217;, or SP), and you see I don&#8217;t have any sort of auth cookie to get me logged in. You forward my browser, along with some header info, over to IdentityProviderSite. IdentityProviderSite says to the end user &#8220;hey, what is your username and password&#8221;, checks that what is entered, maybe does the MFA &#8220;really, prove it&#8221; thing, and then redirects the browser back to the originating website. It includes some header stuff that says &#8220;Hi, I am IdentityProviderSite and I used my trusted private key to sign this message. I promise that the person associated with this connection is really Lisa. And here&#8217;s her important info (could just be username, could be first name, last name, email address, etc) that you can also trust is right.&#8221; No idea why, but the info about the person is called an &#8220;assertion&#8221; &#8212; so you&#8217;ll see talk about mapping assertions (which is basically telling my application that the thing it calls &#8220;logonID&#8221; is going to be called &#8220;userID&#8221; or &#8220;uid&#8221; or whatever in the data coming from IdentityProviderSite). Voila, I&#8217;m now on your website <em>and<\/em> logged in even though my password never transited your system. All you ever got was a promise that the person on this connection is really Lisa.<\/p>\n<p>To accomplish this, there is a &#8216;trust&#8217; between an application &amp; an identity provider &#8212; if you tried to send a web user to IdentityProviderSite without establishing such a trust, it would say &#8220;yeah, I&#8217;m not validating users for you &#8212; I have no idea who <em>you<\/em> are&#8221;. And, similarly, a web app isn&#8217;t going to just <em>trust<\/em> any random source to say &#8220;really, I promise this is Lisa&#8221;. So we go into the web application and say &#8220;I really, really want to trust IdentityProviderSite when it tells me a user&#8217;s ID&#8221; and <em>then <\/em>go into IdentityProviderSite and say &#8220;I want WebApp to be able to ask to validate users&#8221;. And there&#8217;s some crypto stuff because IdentityProviderSite signs it&#8217;s &#8220;I promise this is Lisa&#8221; message &amp; we don&#8217;t want someone to be able to edit that to say &#8220;I promise this is Fred&#8221;.<\/p>\n<p>Why, oh why, is &#8220;where to send the authenticated person back to continue on their merry way&#8221; called an Assertion Consumer Service? The &#8220;service provider&#8221; is supposed to &#8220;consume&#8221; the identity &#8230; so it&#8217;s the URL of the &#8220;assertion consumer&#8221; (i.e. the code in the application that has some clue what to do with the &#8220;I promise this is Lisa&#8221; blob of data that they call an assertion).<\/p>\n<p>Does this make any sense for third-party companies that we really shouldn&#8217;t trust? Companies that aren&#8217;t located on our internal network to access our directories directly? Absolutely! Does this make any sense for our internal stuff? Stuff with direct, encrypted access to the AD directory? Eh &#8230; it goes well with the &#8220;trust no one&#8221; security principal. And points for consistency &#8212; every app&#8217;s logon will look the same. But it&#8217;s a lot of overhead \/ Internet traffic \/ complexity, too.<\/p>\n<p>The basic process flow when a user attempts to use a site is:<\/p>\n<ol class=\"bx--list--ordered--temporary\">\n<li class=\"bx--list__item\">A client attempts to access some web resource to which they are not already authenticated<\/li>\n<li class=\"bx--list__item\">The end web application redirects the client to the Identity Provider.<\/li>\n<li class=\"bx--list__item\">The Identity Provider authenticates the user.<\/li>\n<li class=\"bx--list__item\">The Identity Provider redirects the client to the Assertion Consumer Service (ACS) on the <span class=\"ph\">web resource <\/span>by sending a SAML response over HTTP POST.<\/li>\n<li class=\"bx--list__item\">The web server processes the SAML response.<\/li>\n<li class=\"bx--list__item\">The client is redirected to the actual web application URL<\/li>\n<li class=\"bx--list__item\">The web server authorizes the user to access the requested web resource.<\/li>\n<li class=\"bx--list__item\">The application server sends the HTTP response back to client.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>The basic idea here is that you may want someone to be able to validate your users without actually having access to your passwords or directory data. As a counter-example, a company I work with has their payroll &#8220;stuff&#8221; outsourced. Doing so required a B2B VPN that allowed the hosting company to access an internal &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[1702,341,1488,1701,326],"class_list":["post-9238","post","type-post","status-publish","format-standard","hentry","category-system-administration","tag-federated-identity","tag-identify-management","tag-oauth","tag-saml","tag-sso"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/9238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9238"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/9238\/revisions"}],"predecessor-version":[{"id":9239,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/9238\/revisions\/9239"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}