IPWorks Auth 2020 Java Edition

Questions / Feedback?

SAML Class

Properties   Methods   Events   Configuration Settings   Errors  

The SAML class is used to obtain security tokens and assertions.

Syntax

ipworksauth.Saml

Remarks

The SAML class provides an easy-to-use interface to obtain security tokens and assertions. The class can also be used to parse assertions and inspect the claims within.

The component has built in support for working with Microsoft SharePoint Online and Microsoft Dynamics CRM Online. This support means only a minimum of information needs to be supplied to the component.

Microsoft SharePoint Online and Dynamics CRM Online

To begin working with SharePoint Online or Dynamics CRM Online first set the AuthMode to the appropriate value. The class will automatically populate several properties to known values. Set the User, Password, ApplicationURN properties and call GetSecurityToken. For instance:


component.AuthMode = SAMLAuthModes.amDynamicsCRM; //dynamic crm
component.User = "user@mycrm.onmicrosoft.com";
component.Password = "password";
component.ApplicationURN = "urn:crmapac:dynamics.com";
component.GetSecurityToken();
After calling GetSecurityToken the SecurityTokenXML property will be populated.

ADFS and Others

When working with ADFS or another Security Token Service (STS) the GetAssertion method may be used to obtain an assertion. To begin set AuthMode to either amADFS or amCustom. Then set LocalSTS, User, Password, and ApplicationURN. For instance:


component.AuthMode = SAMLAuthModes.amADFS;
component.User = "administrator";
component.Password = "admin";
component.LocalSTS = "https://adfs.contoso.com";
component.ApplicationURN = "https://fsweb.contoso.com/ClaimsAwareWebAppWithManagedSTS/";
component.GetAssertion();
If the assertion is signed the class will use the certificate specified in SignerCert to verify the signature. If SignerCert is not set the class will attempt to parse the certificate present in the assertion to perform verification.

After the assertion is parsed and the signature is verified (if present) the following properties will be populated:

Parsing an Assertion

The class may also be used to parse an existing assertion without contacting a STS. To parse an existing assertion call ParseAssertion with the assertion XML. If the assertion is signed the class will use the certificate specified in SignerCert to verify the signature. If SignerCert is not set the class will attempt to parse the certificate present in the assertion to perform verification.

After the assertion is parsed and the signature is verified (if present) the following properties will be populated:

Property List


The following is the full list of the properties of the class with short descriptions. Click on the links for further details.

ApplicationURNThe application's Uniform Resource Name (URN).
AssertionIdThe assertion id.
AssertionIssueInstantThe time in UTC that the assertion was issued.
AssertionIssuerThe assertion issuer.
AssertionNotBeforeThe date on which the assertion becomes valid.
AssertionNotOnOrAfterThe time at which the assertion expires.
AssertionSubjectThe subject of the assertion.
AssertionVersionThe version of the assertion.
AssertionXMLThe assertion XML.
AuthModeThe authentication mode.
CertificateThe certificate used for decryption.
ClaimsA collection of claims.
FederationSTSThe URL of the federation Security Token Service (STS).
FederationURNThe federation Uniform Resource Name (URN).
LocalSTSThe local Security Token Service (STS).
PasswordThe user's password.
ProxyA set of properties related to proxy access.
SecurityTokenXMLThe security token XML.
SignerCertThe certificate used for signature verification.
SSLAcceptServerCertInstructs the class to unconditionally accept the server certificate that matches the supplied certificate.
SSLCertThe certificate to be used during SSL negotiation.
SSLServerCertThe server certificate for the last established connection.
UserThe username.
XAttributesA collection of attributes of the current element.
XChildrenCollection of child elements of the current element.
XElementThe name of the current element.
XNamespaceThe namespace of the current element.
XParentThe parent of the current element.
XPathProvides a way to point to a specific element in the document.
XPrefixThe prefix of the current element.
XSubTreeA snapshot of the current element in the document.
XTextThe text of the current element.

Method List


The following is the full list of the methods of the class with short descriptions. Click on the links for further details.

ConfigSets or retrieves a configuration setting.
GetAssertionGets the assertion.
GetSecurityTokenGets the security token.
ParseAssertionParses the specified assertion.

Event List


The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.

CharactersFired for plain text segments of the input stream.
CommentFired when a comment section is encountered.
EndElementFired when an end-element tag is encountered.
ErrorInformation about errors during data delivery.
PIFired when a processing instruction section is encountered.
SSLServerAuthenticationFired after the server presents its certificate to the client.
SSLStatusShows the progress of the secure connection.
StartElementFired when a begin-element tag is encountered in the document.

Configuration Settings


The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.

AssertionXPathThe XPath to the assertion.
DecryptAssertionWhether to decrypt the assertion.
EncryptedAssertionXPathThe XPath to the encrypted assertion.
RawRequestReturns the raw HTTP request.
RawResponseReturns the raw HTTP response.
UserRealmThe URL of a web service to determine the LocalSTS (if any).
BuildInfoInformation about the product's build.
GUIAvailableTells the class whether or not a message loop is available for processing events.
LicenseInfoInformation about the current license.
UseDaemonThreadsWhether threads created by the class are daemon threads.
UseInternalSecurityAPITells the class whether or not to use the system security libraries or an internal implementation.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Auth 2020 Java Edition - Version 20.0 [Build 8155]