ComponentSpace

Forums



How to Add AttributeStatement into saml assertion?


How to Add AttributeStatement into saml assertion?

Author
Message
ahmad1357
ahmad1357
New Member
New Member (36 reputation)New Member (36 reputation)New Member (36 reputation)New Member (36 reputation)New Member (36 reputation)New Member (36 reputation)New Member (36 reputation)New Member (36 reputation)New Member (36 reputation)

Group: Forum Members
Posts: 14, Visits: 71
Hi, I want to add AttributeStatement when initiate SSO.
This is my code to initiate SSO

string partnerIdP = WebConfigurationManager.AppSettings[AppSettings.PartnerIdPTest];
SAMLServiceProvider.InitiateSSO(Response, null, partnerIdP);

I know how to create attribute statement, but I don't know how to add it to the request.
    
AttributeStatement attStatement = new AttributeStatement();
attStatement.Attributes.Add(new SAMLAttribute("Level", SAMLIdentifiers.AttributeNameFormats.Basic, "Level", "Medium"));

Can it be done or I'm I doing something wrong?
ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)

Group: Administrators
Posts: 3.2K, Visits: 11K
There's a SAMLServiceProvider.InitiateSSO overload that takes a singleSignOnServiceUrl. If specified, this is used is used instead of the configured URL.


/// <summary>
/// Initiates single sign-on from the service provider to the identity provider (ie. SP-initiated SSO).
/// <para>
/// An authn request is sent to the identity provider.
/// </para>
/// </summary>
/// <param name="httpResponse">The HTTP response.</param>
/// <param name="relayState">The relay state or <c>null</c> if none.</param>
/// <param name="partnerIdP">The partner identity provider name or <c>null</c>.</param>
/// <param name="ssoOptions">The SSO options or <c>null</c>.</param>
/// <param name="assertionConsumerServiceUrl">The assertion consumer service URL or <c>null</c> if the configured URL is to be used.</param>
/// <param name="singleSignOnServiceUrl">The single sign-on service URL or <c>null</c> if the configured URL is to be used.</param>
/// <exception cref="SAMLException">
/// Thrown when the single sign-on fails.
/// </exception>
public static void InitiateSSO(HttpResponseBase httpResponse, string relayState, string partnerIdP, SSOOptions ssoOptions, string assertionConsumerServiceUrl, string singleSignOnServiceUrl)



For example:

SAMLServiceProvider.InitiateSSO(Response, null, partnerIdP, null, null, singleSignOnServiceUrl);

Regards
ComponentSpace Development
GO


Similar Topics


Execution: 0.000. 3 queries. Compression Enabled.
Login
Existing Account
Email Address:


Password:


Select a Forum....












Forums, Documentation & Knowledge Base - ComponentSpace


Search