{"id":1483,"date":"2015-01-31T12:13:04","date_gmt":"2015-01-31T18:13:04","guid":{"rendered":"https:\/\/www.identityblog.com\/?page_id=1483"},"modified":"2015-01-31T12:31:54","modified_gmt":"2015-01-31T18:31:54","slug":"createalternativesecurityid-transformation","status":"publish","type":"page","link":"https:\/\/www.identityblog.com\/?page_id=1483","title":{"rendered":"CreateAlternativeSecurityId Transformation"},"content":{"rendered":"<div>A CreateAlternativeSecurityId transformation is used to create an &#8216;AlternativeSecurityId&#8217; &#8211; a two-part identifier widely used in AAD\u00a0and consisting of:<\/div>\n<ol style=\"padding-left: 100px;\">\n<li style=\"padding-left: 30px;\">the name of an identity provider; and<\/li>\n<li style=\"padding-left: 30px;\">a unique naming claim\u00a0identifying objects\u00a0within that\u00a0identity provider&#8217;s namespace.<\/li>\n<\/ol>\n<p>An example would be Microsoft Account (MSA) as an identity provider and &#8216;john@hotmail.com&#8217; as a unique name (called a &#8216;key&#8217;) inside the MSA&#8217;s namespace.\u00a0 Although its actual encoding\u00a0would be\u00a0different, one can think of it as being:<br \/>\n<code><br \/>\n{<br \/>\n\"identityProvider\" : \"MSA\",<br \/>\n\"key\" : \"john@hotmail.com\"<br \/>\n}<br \/>\n<\/code><br \/>\nThis construct is important because John might, for example, use\u00a0his email address\u00a0at Hotmail or Google as his account name at\u00a0facebook&#8230;\u00a0 The AlternativeSecurityIds would then distinguish the various accounts, since in the facebook case the AlternativeSecurityId can be thought of as:<br \/>\n<code><br \/>\n{<br \/>\n\"identityProvider\" : \"facebook\",<br \/>\n\"key\" : \"john@hotmail.com\"<br \/>\n}<br \/>\n<\/code><\/p>\n<div>\n<table style=\"border-collapse: collapse; background: #e2efd9;\" border=\"0\">\n<colgroup>\n<col style=\"width: 615px;\" \/><\/colgroup>\n<tbody valign=\"top\">\n<tr>\n<td style=\"padding-left: 9px; padding-right: 9px; border: solid #bfbfbf 0.5pt;\">\n<p style=\"text-align: center;\"><span style=\"font-size: 12pt;\"><strong>InputClaims<\/strong><\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table style=\"border-collapse: collapse;\" border=\"0\">\n<colgroup>\n<col style=\"width: 277px;\" \/>\n<col style=\"width: 338px;\" \/><\/colgroup>\n<tbody valign=\"top\">\n<tr style=\"background: white;\">\n<td style=\"padding-left: 9px; padding-right: 9px; border-bottom: solid #7f7f7f 0.5pt;\">\n<p style=\"text-align: right;\"><span style=\"font-size: 13pt;\"><em>TransformationClaimType<\/em><\/span><\/p>\n<\/td>\n<td style=\"padding-left: 9px; padding-right: 9px; border-bottom: solid #7f7f7f 0.5pt;\"><span style=\"font-size: 13pt;\"><em>Description<\/em><\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"background: white; padding-left: 9px; padding-right: 9px; border-right: solid #7f7f7f 0.5pt;\">\n<p style=\"text-align: right;\"><span style=\"font-size: 13pt;\"><em>identityProvider<\/em><\/span><\/p>\n<\/td>\n<td style=\"background: #f2f2f2; padding-left: 9px; padding-right: 9px;\">The identity provider asserting an account name<\/td>\n<\/tr>\n<tr>\n<td style=\"background: white; padding-left: 9px; padding-right: 9px; border-right: solid #7f7f7f 0.5pt;\">\n<p style=\"text-align: right;\"><span style=\"font-size: 13pt;\"><em>key<\/em><\/span><\/p>\n<\/td>\n<td style=\"background: #f2f2f2; padding-left: 9px; padding-right: 9px;\">THe unique account name within the identity provider&#8217;s namespace<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table style=\"border-collapse: collapse; background: #e2efd9;\" border=\"0\">\n<colgroup>\n<col style=\"width: 615px;\" \/><\/colgroup>\n<tbody valign=\"top\">\n<tr>\n<td style=\"padding-left: 9px; padding-right: 9px; border: solid #bfbfbf 0.5pt;\">\n<p style=\"text-align: center;\"><span style=\"font-size: 12pt;\"><strong>OutputClaims<\/strong><\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table style=\"border-collapse: collapse;\" border=\"0\">\n<colgroup>\n<col style=\"width: 277px;\" \/>\n<col style=\"width: 338px;\" \/><\/colgroup>\n<tbody valign=\"top\">\n<tr style=\"background: white;\">\n<td style=\"padding-left: 9px; padding-right: 9px; border-bottom: solid #7f7f7f 0.5pt;\">\n<p style=\"text-align: right;\"><span style=\"font-size: 13pt;\"><em>TransformationClaimType<\/em><\/span><\/p>\n<\/td>\n<td style=\"padding-left: 9px; padding-right: 9px; border-bottom: solid #7f7f7f 0.5pt;\"><span style=\"font-size: 13pt;\"><em>Description<\/em><\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"background: white; padding-left: 9px; padding-right: 9px; border-right: solid #7f7f7f 0.5pt;\">\n<p style=\"text-align: right;\"><span style=\"font-size: 13pt;\"><em>alternativeSecurityId<\/em><\/span><\/p>\n<\/td>\n<td style=\"background: #f2f2f2; padding-left: 9px; padding-right: 9px;\">The encoded alternativeSecurityId<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table style=\"border-collapse: collapse; background: #e2efd9;\" border=\"0\">\n<colgroup>\n<col style=\"width: 615px;\" \/><\/colgroup>\n<tbody valign=\"top\">\n<tr>\n<td style=\"padding-left: 9px; padding-right: 9px; border: solid #bfbfbf 0.5pt;\">\n<p style=\"text-align: center;\"><span style=\"font-size: 12pt;\"><strong>Example<\/strong><\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<p>This example defines a ClaimsTransformation of the &#8216;CreateAlternativeSecurityId&#8217; type called &#8216;CreateALternativeSecurityId&#8217; .\u00a0The policy schema&#8217;s &#8216;userId&#8217; and &#8216;identityProvider&#8217; claims are transformed into an encoded AlternativeSecurityId which is returned as alternativeSecurityId claim.<\/p>\n<\/div>\n<p><!-- code formatted by http:\/\/manoli.net\/csharpformat\/ --><\/p>\n<pre class=\"csharpcode\">      \r\n<span class=\"kwrd\">&lt;<\/span><span class=\"html\">ClaimsTransformation<\/span> <span class=\"attr\">Id<\/span><span class=\"kwrd\">=\"CreateAlternativeSecurityId\"<\/span> <span class=\"attr\">TransformationMethod<\/span><span class=\"kwrd\">=\"CreateAlternativeSecurityId\"<\/span><span class=\"kwrd\">&gt;<\/span>\r\n        <span class=\"kwrd\">&lt;<\/span><span class=\"html\">InputClaims<\/span><span class=\"kwrd\">&gt;<\/span>\r\n          <span class=\"kwrd\">&lt;<\/span><span class=\"html\">InputClaim<\/span> <span class=\"attr\">ClaimTypeReferenceId<\/span><span class=\"kwrd\">=\"userId\"<\/span> <span class=\"attr\">TransformationClaimType<\/span><span class=\"kwrd\">=\"key\"<\/span> <span class=\"kwrd\">\/&gt;<\/span>\r\n          <span class=\"kwrd\">&lt;<\/span><span class=\"html\">InputClaim<\/span> <span class=\"attr\">ClaimTypeReferenceId<\/span><span class=\"kwrd\">=\"identityProvider\"<\/span> <span class=\"attr\">TransformationClaimType<\/span><span class=\"kwrd\">=\"identityProvider\"<\/span> <span class=\"kwrd\">\/&gt;<\/span>\r\n        <span class=\"kwrd\">&lt;\/<\/span><span class=\"html\">InputClaims<\/span><span class=\"kwrd\">&gt;<\/span>\r\n        <span class=\"kwrd\">&lt;<\/span><span class=\"html\">OutputClaims<\/span><span class=\"kwrd\">&gt;<\/span>\r\n          <span class=\"kwrd\">&lt;<\/span><span class=\"html\">OutputClaim<\/span> <span class=\"attr\">ClaimTypeReferenceId<\/span><span class=\"kwrd\">=\"alternativeSecurityId\"<\/span> <span class=\"attr\">TransformationClaimType<\/span><span class=\"kwrd\">=\"alternativeSecurityId\"<\/span> <span class=\"kwrd\">\/&gt;<\/span>\r\n        <span class=\"kwrd\">&lt;\/<\/span><span class=\"html\">OutputClaims<\/span><span class=\"kwrd\">&gt;<\/span>\r\n      <span class=\"kwrd\">&lt;\/<\/span><span class=\"html\">ClaimsTransformation<\/span><span class=\"kwrd\">&gt;<\/span>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>A CreateAlternativeSecurityId transformation is used to create an &#8216;AlternativeSecurityId&#8217; &#8211; a two-part identifier widely used in AAD\u00a0and consisting of: the name of an identity provider; and a unique naming claim\u00a0identifying objects\u00a0within that\u00a0identity provider&#8217;s namespace. An example would be Microsoft Account (MSA) as an identity provider and &#8216;john@hotmail.com&#8217; as a unique name (called a &#8216;key&#8217;) inside &hellip; <a href=\"https:\/\/www.identityblog.com\/?page_id=1483\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">CreateAlternativeSecurityId Transformation<\/span><\/a><\/p>\n","protected":false},"author":68,"featured_media":0,"parent":1453,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/www.identityblog.com\/index.php?rest_route=\/wp\/v2\/pages\/1483"}],"collection":[{"href":"https:\/\/www.identityblog.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.identityblog.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.identityblog.com\/index.php?rest_route=\/wp\/v2\/users\/68"}],"replies":[{"embeddable":true,"href":"https:\/\/www.identityblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1483"}],"version-history":[{"count":4,"href":"https:\/\/www.identityblog.com\/index.php?rest_route=\/wp\/v2\/pages\/1483\/revisions"}],"predecessor-version":[{"id":1488,"href":"https:\/\/www.identityblog.com\/index.php?rest_route=\/wp\/v2\/pages\/1483\/revisions\/1488"}],"up":[{"embeddable":true,"href":"https:\/\/www.identityblog.com\/index.php?rest_route=\/wp\/v2\/pages\/1453"}],"wp:attachment":[{"href":"https:\/\/www.identityblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}