ComponentSpace

Forums



How-to read "session index"


How-to read "session index"

Author
Message
stefano.tosolini@component...
stefano.tosolini@componentspace
New Member
New Member (2 reputation)New Member (2 reputation)New Member (2 reputation)New Member (2 reputation)New Member (2 reputation)New Member (2 reputation)New Member (2 reputation)New Member (2 reputation)New Member (2 reputation)

Group: Forum Members
Posts: 1, Visits: 62
i'm developing a SAML authentication for our apps, all went fine with encryption, signature verification, ...
Actually i'm stuck trying to read the "session index" that i see in the trace:

Name ID: <saml:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">johndoe</saml:NameID>
Session index: 04386a0f-753e-47ea-83e8-ad39eab656d4::51231c12-467e-49f2-b427-c01d296d2ae5

i believe this index can be usefull to my needs, i wish to save it in a custom table with some other information from the assertion to make them available to other applications

thks in advance
ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)ComponentSpace Development (3.9K reputation)

Group: Administrators
Posts: 2.8K, Visits: 8.5K
The following code demonstrates retrieving the session index from the authn statement.


// Save the session index from the SAML assertion.
string sessionIndex;

_samlServiceProvider.Events.OnSamlAssertionReceived += (httpContext, samlAssertion) =>
{
  var authenticationStatements = samlAssertion.GetAuthenticationStatements();

  if (authenticationStatements != null && authenticationStatements.Count > 0)
  {
   sessionIndex = authenticationStatements[0].SessionIndex;
  }
};

// Receive and process the SAML assertion contained in the SAML response.
// The SAML response is received either as part of IdP-initiated or SP-initiated SSO.
var ssoResult = await _samlServiceProvider.ReceiveSsoAsync();




Regards
ComponentSpace Development
GO


Similar Topics


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


Password:


Social Logins

Select a Forum....









Forums, Documentation & Knowledge Base - ComponentSpace


Search