.NET Framework Bookmark and Share   
 index > Claims based access platform (CBA), code-named Geneva > Define NameFormat in NameID Element in Beta2
 

Define NameFormat in NameID Element in Beta2

Hi,
I managed it to set the NameID element into a SAML 2.0 Assertion (using WebSSO) with the Claim NameIdentifier. The element will be added without any NameFormat. Is this possible in Genevas Beta2 or only in the final version.?


thanks,
-markus

markus.strehle

Hi Markus,

You cannot directly set the name identifier format from extraction rule.

You can extract the mail from attribute store and put it to evaluation context (notice add instead of issue):

c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname"]
=>
add(
store = "Enterprise Active Directory User Account Store", types = ("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"),
query = "sAMAccountName={0};mail;{1}", param = regexreplace(c.Value, "(?<domain>[^\\]+)\\(?<user>.+)", "${user}"), param = c.Value);

And then create name identifier claim from emailaddress claim using following advanced rule:

c:[Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"]
=>
issue(
Type = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier",
Value = c.Value,
Properties["http://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/format"] = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress");

Mieszko Matkowski
You have to set certain properties on the NameIdentifier claim - something like

claim.Properties[ClaimProperties.SamlNameIdentifierFormat] = "..."

have a look at the ClaimProperties class.

Dominick Baier | thinktecture | http://www.leastprivilege.com
Dominick Baier
Hi,

thanks for the suggestion, but I mean withing the Claim Rule Editior in Geneva Server Beta2 and not within .Net Framework programming.

If I add a Claim to my Relying Party e.g.:

c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname"]
=> issue(store = "Enterprise Active Directory User Account Store", types = ("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier"), query = "sAMAccountName={0};mail;{1}", param = regexreplace(c.Value, "(?<domain>[^\\]+)\\(?<user>.+)", "${user}"), param = c.Value);

then the Mailadress is added as SAML element NameID to the Assertions, but without any NameFormat. This means in SAML syntax "urn:oasis:names:tc:SAML:1.0:nameid-format:unspecified" and its wrong, therefore the questions:

How can I set "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" as NameFormat by changing the Claim above or with any other addional Claim withing the Claim Rules edition. I checked the Claim Rule Language "http://technet.microsoft.com/en-us/library/dd807118(WS.10).aspx" but dont understand how to add the NameFormat.

thanks,
-markus
markus.strehle

Hi Markus,

You cannot directly set the name identifier format from extraction rule.

You can extract the mail from attribute store and put it to evaluation context (notice add instead of issue):

c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname"]
=>
add(
store = "Enterprise Active Directory User Account Store", types = ("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"),
query = "sAMAccountName={0};mail;{1}", param = regexreplace(c.Value, "(?<domain>[^\\]+)\\(?<user>.+)", "${user}"), param = c.Value);

And then create name identifier claim from emailaddress claim using following advanced rule:

c:[Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"]
=>
issue(
Type = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier",
Value = c.Value,
Properties["http://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/format"] = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress");

Mieszko Matkowski
Hi,
thanks for your reply, with this code I manage it to set NameID element so that our SAML SP consumes the mail adress as defined by format.
regards,
-markus
markus.strehle

You can use google to search for other answers

Custom Search

More Threads

• How to resolve ID3112: Unrecognized RequestType '' specified in the incoming request
• Error MSIS7042
• geneva fx 64bit considerations?
• Geneva Server ConfigWizard error
• How to obtain the secure token / claimset from the client
• Geneva Server Configuration Wizard - Provider Load Faliure
• Problem with Core Vista Audio
• Geneva Server's remote and local administration endpoints simultaneously.
• Compairing URI to get certificates from database in GetScope
• Running Geneva server without active directory (custom information in SQL)