ComponentSpace

Forums



Missing SubjectLocality in Saml Response


Missing SubjectLocality in Saml Response

Author
Message
s k
s k
New Member
New Member (15 reputation)New Member (15 reputation)New Member (15 reputation)New Member (15 reputation)New Member (15 reputation)New Member (15 reputation)New Member (15 reputation)New Member (15 reputation)New Member (15 reputation)

Group: Forum Members
Posts: 8, Visits: 74
I need to add missing field(SubjectLocality) in SAML Response
<saml:SubjectLocality Address="1.1.1.1" DNSName="abc.org"/>

Can you please let me know how to generate this
ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (3.8K reputation)ComponentSpace Development (3.8K reputation)ComponentSpace Development (3.8K reputation)ComponentSpace Development (3.8K reputation)ComponentSpace Development (3.8K reputation)ComponentSpace Development (3.8K reputation)ComponentSpace Development (3.8K reputation)ComponentSpace Development (3.8K reputation)ComponentSpace Development (3.8K reputation)

Group: Administrators
Posts: 2.7K, Visits: 8.4K
It's unusual to include a SubjectLocality which is why it isn't directly part of the SAML high-level API. However, you can update the SAML assertion prior to its transmission using the SAML notifications interface. The following example receives the OnSAMLAssertionCreated event and updates the SAML assertion.


using ComponentSpace.SAML2.Assertions;
using ComponentSpace.SAML2.Notifications;

public class ExampleSAMLObserver : AbstractSAMLObserver
{
  public override SAMLAssertion OnSAMLAssertionCreated(string partnerName, SAMLAssertion samlAssertion)
  {
   samlAssertion.GetAuthenticationStatements()[0].SubjectLocality = new SubjectLocality()
   {
      Address = "1.1.1.1",
      DNSName = "abc.org"
   };

   return samlAssertion;
  }
}



Typically you register the event handler at application start-up.


SAMLObservable.Subscribe(new ExampleSAMLObserver());




Regards
ComponentSpace Development
GO


Similar Topics


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


Password:


Social Logins

Select a Forum....









Forums, Documentation & Knowledge Base - ComponentSpace


Search