Attribute Profile

Hi, i have to provide my attributes using the following profile. How do i go about achieving this? Any help will be much appreciated.

There are a couple of options.
If all you need to include are the attribute name and value, your code would be similar to the following.

var attributes = new Dictionary<string, string>()
{
{ “email”, “johndoe@componentspace.com” },
{ “firstname”, “John” },
{ “lastname”, “Doe” }
};

SAMLIdentityProvider.InitiateSSO(
Response,
userName,
attributes,
targetUrl,
partnerSP);

The dictionary of name/value pairs will be added to the SAML assertion as SAML attribute name/value pairs.
If you have to include the OID as well, and assuming the OID is the attribute name and the other name is the friendly name, your code would be similar to the following.

var attributes = new SAMLAttribute[]
{
new SAMLAttribute(“urn:oid:0.9.2342.19200300.100.1.3”, null, “email”, “johndoe@componentspace.com”),
new SAMLAttribute(“urn:oid:2.5.4.42”, null, “firstname”, “John”),
new SAMLAttribute(“urn:oid:2.5.4.4”, null, “lastname”, “Doe”)
};

SAMLIdentityProvider.InitiateSSO(
Response,
userName,
attributes,
targetUrl,
partnerSP);

Thank you! i will give it a try.

You’re welcome.