{"id":1699,"date":"2010-02-28T18:49:22","date_gmt":"2010-02-28T23:49:22","guid":{"rendered":"http:\/\/www.coresecuritypatterns.com\/blogs\/?p=1699"},"modified":"2020-08-08T04:20:54","modified_gmt":"2020-08-08T04:20:54","slug":"saml-attribute-exchange-for-x509-authentication-based-identity-federation","status":"publish","type":"post","link":"https:\/\/websecuritypatterns.com\/blogs\/2010\/02\/28\/saml-attribute-exchange-for-x509-authentication-based-identity-federation\/","title":{"rendered":"SAML Attribute Exchange for X.509 Authentication based Identity Federation"},"content":{"rendered":"<p>In a typical Single Sign-On (SSO)\/Federation scenario&nbsp;using SAML,&nbsp;the Service Provider (SP) initiates the user authentication request using SAML <strong><em>AuthnRequest<\/em><\/strong> assertion with an Identity Provider (IDP). The IDP authenticates the principal and returns a SAML <em><strong>AuthnStatement<\/strong> <\/em>assertion response confirming the user authentication. If the user is successfully authenticated, the SP is required to have the subject&#8217;s profile attributes of the authenticated principal for making local authorization decisions. To obtain the subject&#8217;s profile attributes (ex. organization, email, role), the SP initiates a SAML <strong><em>AttributeQuery<\/em><\/strong> request with the target IDP.&nbsp; The IDP returns a response SAML <strong><em>AttributeStatement<\/em><\/strong> assertion listing the name of the attributes and the associated values.&nbsp; Using the subject&#8217;s profile attributes, the SP can perform authorization operations.<\/p>\n<p>Ofcourse, it looks simple&#8230;here is the complexity &#8211; Last two weeks I spent on building a Proof-of-Concept that conforms to <a href=\"http:\/\/www.idmanagement.gov\/awg\/documents\/BackendArchitectureInterfaceSpec.pdf\" target=\"_blank\" rel=\"noopener noreferrer\">HSPD-12 Back-end Attribute Exchange specifications<\/a> and <a href=\"http:\/\/www.oasis-open.org\/committees\/download.php\/27766\/sstc-saml-x509-authn-attrib-profile-cs-01.pdf\">SAMLv2 Attribute Sharing Profile for X.509 Authentication based systems<\/a>&nbsp;(Both specifications are mandated as part of <a href=\"http:\/\/www.idmanagement.gov\" target=\"_blank\" rel=\"noopener noreferrer\">Federal Identity, Credential and Access Management (ICAM)<\/a> initiative of <a href=\"http:\/\/www.cio.gov\" target=\"_blank\" rel=\"noopener noreferrer\">Federal CIO Council<\/a>).&nbsp; I had been experimenting with an Identity Federation scenario that makes use of Smartcard\/PKI credentials &#8211; Card Authentication Key (CAK)\/X.509 Certificate on a PIV card authenticates a PKI provider (using OCSP) and then using its X.509 credential attributes (Subject DN) for looking up off-card user attributes from an IDP (that acts as an Attribute Authority). The IDP provides the user profile attribute information to the requesting SP. In simpler terms, the SP initiated X.509 authentication directly&nbsp; via OCSP request\/response with a Certificate Validation Authority (VA) of a Certificate Authority (CA). Upon successful authentication, the SP&nbsp; initiates a SAML AttributeQuery to the IDP (which acts as an Attribute Authority), the SAML AttributeQuery uses the <em>SubjectDN<\/em> of the authenticated principal from the X.509 certificate and requests the IDP to provide the subject&#8217;s user profile attributes.<\/p>\n<h3>Using Fedlet for SAML X.509 Authentication based Attribute Sharing<\/h3>\n<div id=\"attachment_1719\" style=\"width: 602px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.websecuritypatterns.com\/blogs\/wp-content\/uploads\/2010\/02\/samlattributequery.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1719\" class=\"size-full wp-image-1719\" src=\"http:\/\/www.websecuritypatterns.com\/blogs\/wp-content\/uploads\/2010\/02\/samlattributequery.jpg\" alt=\"\" width=\"592\" height=\"360\"><\/a><p id=\"caption-attachment-1719\" class=\"wp-caption-text\">SAML Attribute Exchange for X.509 based Authentication<\/p><\/div>\n<p>Fedlet is a lightweight SAMLv2 based Service Provider (SP) implementation (currently part of Sun OpenSSO 8.x and <a href=\"http:\/\/blog.talkingidentity.com\/2010\/01\/expanding-on-the-oracle-sun-idm-strategy.html\" target=\"_blank\" rel=\"noopener noreferrer\">sooner to be available in Oracle Identity Federation<\/a>) for enabling SAMLv2 based Single Sign-On environment. In simpler terms, Fedlet allows an Identity Provider (IDP) to enable an SP that need not have federation implemented. The SP plugs in the Fedlet to a Java\/.NET web application and then ready to initiate SAML v2 based SSO authentication, authorization and attribute exchanges.&nbsp; A Fedlet installed and configured with a SP can set up to use multiple IDPs where select IDPs can acts as Attribute Authorities. In this case, the Fedlet need to update its configuration with the IDP Metadata configuration (such as entity ID, IDP Meta Alias, Attribute Authority Meta Alias &#8211; same as IDP ). In addition, the Fedlets&nbsp;are capable of&nbsp;performing XML signature verification and decryption of responses from the IDP must identify the alias of signing and encryption certificates.<\/p>\n<p>Here is the <a href=\"http:\/\/wikis.sun.com\/display\/OpenSSO\/Configuring+the+OpenSSO+Express+8+Java+Fedlet+for+SAMLv2+Attribute+Query\" target=\"_blank\" rel=\"noopener noreferrer\">quick documentation,<\/a> which I referred&nbsp; for putting together the solution using Fedlets for SAMLv2 Attribute Sharing for X.509 based authentication scenarios. In case, if you want your Service Provider&nbsp;to use&nbsp;OpenSSO for PIV\/CAC based certificate authentication, you may refer to my earlier entry on <a href=\"http:\/\/www.websecuritypatterns.com\/blogs\/?p=644\" target=\"_blank\" rel=\"noopener noreferrer\">Smartcard\/PKI authentication based SSO (Using OpenSSO)<\/a>. Besides that you should be good to test-drive your excercise. Ofcourse, you can use Fedlets for&nbsp;Microsoft .NET service providers but it&nbsp;was&#8217;nt in my scope of work !<\/p>\n<p>In case of SP requiring to fetch multiple user profile attributes you may also choose to&nbsp;use SPML based queries&nbsp;(<a href=\"http:\/\/www.websecuritypatterns.com\/blogs\/?tag=spml20\">SPML Lookup\/Update\/Batch Request\/Response<\/a>)&nbsp;to an Identity Manager (acting as Attribute Authority) &#8211; assuming it facilitates an SPML implementation).&nbsp;If you are looking for a solution that requires&nbsp;user profile attributes after a single-user X.509 authentication, then&nbsp;SAML Attribute query should help&nbsp;fetching a single user profile of an authenticated principal !<\/p>\n<p>\ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a typical Single Sign-On (SSO)\/Federation scenario&nbsp;using SAML,&nbsp;the Service Provider (SP) initiates the user authentication request using SAML AuthnRequest assertion with an Identity Provider (IDP). The IDP authenticates the principal and returns a SAML AuthnStatement assertion response confirming the user authentication. If the user is successfully authenticated, the SP is required to have the subject&#8217;s profile attributes of the authenticated&#8230; <a href=\"https:\/\/websecuritypatterns.com\/blogs\/2010\/02\/28\/saml-attribute-exchange-for-x509-authentication-based-identity-federation\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4,5,6,8,9,11],"tags":[37,39,51,55,57,60,62,64,66,75],"class_list":["post-1699","post","type-post","status-publish","format-standard","hentry","category-compliance","category-identity-management","category-main","category-pki-main","category-security","category-smartcards-pki","tag-j2ee","tag-java","tag-opensso","tag-piv","tag-pki-main","tag-saml","tag-security","tag-smartcards","tag-spml","tag-ws-security"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/websecuritypatterns.com\/blogs\/wp-json\/wp\/v2\/posts\/1699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/websecuritypatterns.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/websecuritypatterns.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/websecuritypatterns.com\/blogs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/websecuritypatterns.com\/blogs\/wp-json\/wp\/v2\/comments?post=1699"}],"version-history":[{"count":2,"href":"https:\/\/websecuritypatterns.com\/blogs\/wp-json\/wp\/v2\/posts\/1699\/revisions"}],"predecessor-version":[{"id":2846,"href":"https:\/\/websecuritypatterns.com\/blogs\/wp-json\/wp\/v2\/posts\/1699\/revisions\/2846"}],"wp:attachment":[{"href":"https:\/\/websecuritypatterns.com\/blogs\/wp-json\/wp\/v2\/media?parent=1699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/websecuritypatterns.com\/blogs\/wp-json\/wp\/v2\/categories?post=1699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/websecuritypatterns.com\/blogs\/wp-json\/wp\/v2\/tags?post=1699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}