<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>John James Andersen &#187; Service-Now</title>
	<atom:link href="http://www.john-james-andersen.com/category/blog/service-now/feed" rel="self" type="application/rss+xml" />
	<link>http://www.john-james-andersen.com</link>
	<description>The Personal &#38; Professional Website</description>
	<lastBuildDate>Tue, 07 Feb 2012 16:49:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ServiceNow SAML 2.0 &#8211; Additional Configurations Update Set</title>
		<link>http://www.john-james-andersen.com/blog/service-now/servicenow-saml-2-0-additional-configurations-update-set.html</link>
		<comments>http://www.john-james-andersen.com/blog/service-now/servicenow-saml-2-0-additional-configurations-update-set.html#comments</comments>
		<pubDate>Tue, 07 Feb 2012 16:25:57 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Service-Now]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=1267</guid>
		<description><![CDATA[Over the past few months I have had a number of clients contact me with issues regarding SAML 2.0. Due to the complexity of SAML 2.0, and the plethora of options associated with the specification, there are obviously many differences between IdP&#8217;s. What works for one, doesn&#8217;t always work for another. I have taken the [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past few months I have had a number of clients contact me with issues regarding SAML 2.0.  Due to the complexity of SAML 2.0, and the plethora of options associated with the specification, there are obviously many differences between IdP&#8217;s.  What works for one, doesn&#8217;t always work for another.</p>
<p>I have taken the customizations suggested in my blog over the past few months and combined them into an update set that can be applied to enhance the configuration capabilities of your SAML 2.0 plugin in ServiceNow.</p>
<h1>The New Settings</h1>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/settingsnormal.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/settingsnormal.png" alt="" title="settingsnormal" width="508" height="232" class="aligncenter size-full wp-image-1278" /></a></p>
<p>Here is the breakdown on some of the new settings:</p>
<p><strong><em>Send the SP Name Qualifier attribute with the NameID Policy in our SAML 2.0 requests. </em></strong><br />
This setting allows you tell ServiceNow not to set a SP Name Qualifier attribute on our NameID Policy in the AuthnRequest statement.  It is optional by SAML specifications. ADFS and Shibboleth both do not accept the statement as it has been implemented by ServiceNow.  You can typically set this to &#8220;False&#8221; and be better off.  It defaults to true simply to be backward compatible for people already using the SAML 2.0 plugin.</p>
<p><strong><em>Create an AuthnContextClass request in the AuthnRequest statement.</em></strong><br />
The AuthnContextClass attribute is typically sent by default in the original plugin.  This attribute tells the IdP that ServiceNow requires that they use a specific type of authentication for a user.  Shibboleth, and ADFS in some situations, don&#8217;t like to be told how they should present their authentication to the user on their own IdP.  Usually it is an environmental situation with Kerberos, or Proxy servers.  You can now choose not to require a specific type of authentication mechanism and just let the IdP decide this.</p>
<p><strong><em>The AuthnContextClassRef method that we will request in our SAML 2.0 AutnReqeust to the Identity Provider</em></strong><br />
If you do want to tell the IdP what type of authentication to present the user, then you can also specific what that type is.  By default we have always sent a PasswordProtectedTransport requirement which is essential a form-based authentication page.  However, you can allow the IdP to use their Kerberos setup by specifying urn:federation:authentication:windows as the context class ref.  This setting lets you specify that as a configuration setting rather than by modifying the SAML scripts.</p>
<h1>Other Enhancements</h1>
<p><strong><em>Unique SAML ID</em></strong><br />
In the past, ServiceNow has been sending the browser Session ID as the SAML request ID.  However, the SAML specification states that this ID field needs to be unique for EVERY request.  This ID can then be used by the IdP to help prevent replay attacks.  This update set makes that ID unique for every SAML request that is sent by the system.</p>
<p><strong><em>Making the AuthnRequest function scriptable</em></strong><br />
Most users won&#8217;t need this, but I have some ideas for a future integration, but it requires some flexibility in changing the AuthnRequest parameters based on a situation rather than on an instance.  I made some changes that will facilitate that in the future if we ever go down that route.</p>
<p><strong><em>Hardcoded attributes can be set via properties</em></strong><br />
There are a number of hard coded properties in our SAML statements.  They are hard coded for a good reason.  However, if there are any situations where we need to deviate from the default to support a new IdP, it would be nice to be able to create a property that overrides the hard coded attribute.  Where I could safely, I changed most hard coded attributes to be override-able via system properties if necessary.</p>
<p><strong><em>Handle Null Prefixes in SAML Response</em></strong><br />
Site-Minder and potentially other IdP&#8217;s do not provide a namespace prefix on their SAMLResponse when it comes back to ServiceNow.  In these cases, the authentication process would always fail with ServiceNow, even after the user authenticated against the IdP.  I modified the SAML code to handle this situation gracefully so that we can support Site-Minder SAML out of the box.</p>
<h1>The Update Set</h1>
<p>I will be working with the ServiceNow development team to get these changes into the plugin so that this update set won&#8217;t be necessary in the future.  However, I have several clients that need these settings today.  If you need some of the settings explained above, feel free to download the update set and give it a try.  Please note that if you do use the update set, you do so at your own risk as this is not part of the product and is not covered by technical support.  However, if something does seem to break, slip me a pizza and I might offer personal support of my own.</p>
<h1>Download</h1>
<div style='font-size: 10px;'>
  Click below to download your item:
</div>

<div style=
'font-size: 20px; font-weight: bold; font-color: E07E1B; vertical-align: middle; background-color: #E0DFD5; padding: 4px;'>
<a href="http://www.john-james-andersen.com/file-download/SAML+2.0+Additional+Config+Options" title="Downloaded 6 times"><img src=
"/images/DownloadButton.png" alt="SAML 2.0 Additional Config Options" style=
'vertical-align: middle; padding-bottom: 4px; padding-right: 5px;' />SAML 2.0 Additional Config Options</a>
</div>
<div style=
'font-size: 10px; font-weight: normal; font-color: red; vertical-align: left; background-color: #E0DFD5; padding: 2px;'>
This file is not supported nor authored by Service-now.com.  Please
use at your own risk.
</div>
<br />

]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/service-now/servicenow-saml-2-0-additional-configurations-update-set.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Supporting Kerberos Authentication with ADFS in ServiceNow</title>
		<link>http://www.john-james-andersen.com/blog/service-now/supporting-kerberos-authentication-with-adfs-in-servicenow.html</link>
		<comments>http://www.john-james-andersen.com/blog/service-now/supporting-kerberos-authentication-with-adfs-in-servicenow.html#comments</comments>
		<pubDate>Wed, 25 Jan 2012 15:30:10 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Service-Now]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=1260</guid>
		<description><![CDATA[If 2011 was the year of ADFS SAML 2.0 implementations in ServiceNow, then 2012 looks like it will be the year of Kerberos Authentication with ADFS and ServiceNow. Over the past few weeks I have had a number of customers contact me regarding better support of their Kerberos authentication when they are using ADFS and [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.john-james-andersen.com/wp-content/uploads/laptop-300x214.jpg" alt="" title="laptop" width="300" height="214" class="aligncenter size-medium wp-image-1261" /></p>
<p>If 2011 was the year of ADFS SAML 2.0 implementations in ServiceNow, then 2012 looks like it will be the year of Kerberos Authentication with ADFS and ServiceNow.</p>
<p>Over the past few weeks I have had a number of customers contact me regarding better support of their Kerberos authentication when they are using ADFS and SAML to do Single Sign-on with ServiceNow.</p>
<p>Thanks to some help from Microsoft, and a lot of coordination from a client in Switzerland, we have been able to provide better support for users who are logging into ServiceNow via Kerberos authentication with Windows.</p>
<p>The idea behind Kerberos authentication is that when you authenticate to the Windows desktop, you are establishing a SAML session.  If someone browses to ServiceNow and they don&#8217;t have an active ServiceNow session, the SAML should detect that they have a SAML session alive through Kerberos and automatically authenticate the user into ServiceNow without having to type ADFS credentials. </p>
<p>However, with the current setup, regardless of the user having a SAML session via Kerberos, ServiceNow would redirect to the IdP and the IdP would display the ADFS login screen.  It wasn&#8217;t detecting the Kerberos session.</p>
<p>The reason behind this situation is that the ServiceNow SAML plugin supports PasswordProtectedTransport for it&#8217;s authentication context.  This is also known as &#8220;forms-based authentication&#8221;.  This tells the IdP that the user should be presented a form by the IdP where they should authenticate.  However, with Kerberos, the SAML session is already active through an established Windows login, so the user shouldn&#8217;t have to be presented a form for authentication.</p>
<p>The bad news here is that ServiceNow SAML 2.0 does not support Windows authentication out of the box.  The good news, however, is that it is an easy customization.</p>
<h1>The Theory</h1>
<p>SAML has an attribute that tells the IdP what type of authentication we are expecting them to perform in order to qualify a user.  This attribute is the AuthnContextClassRef.  This element takes a URN string that identifies that method.</p>
<p>As mentioned previously, the PasswordProtectedTransport method indicates that we require form-based authentication.  The string used to identify that is:  </p>
<pre>
urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport
</pre>
<p>The Windows authentication methodology is specified by using this string:</p>
<pre>
urn:federation:authentication:windows
</pre>
<p>This tells the ADFS IdP that we are expecting that they try their Windows login in order to validate the authentication of a given user.</p>
<h1>The Solution</h1>
<blockquote><p><em>New Update:  If you download the update set that provides <a href="http://www.john-james-andersen.com/blog/service-now/servicenow-saml-2-0-additional-configurations-update-set.html" title="Additional SAML 2.0 Options">Additional SAML 2.0 Configuration Options</a> then you will not need to modify the SAML scripts as outlined below. </em></p></blockquote>
<p>In order to enjoy the full benefits of a Kerberos authentication setup with ADFS, perform the following steps:</p>
<p>1) Perform the steps outlined in my blog post: <a href="http://www.john-james-andersen.com/blog/service-now/ad-fs-2-0-working-with-servicenow-saml-2-0.html" title="AD FS 2.0 working with ServiceNow SAML 2.0" target="_blank">AD FS 2.0 working with ServiceNow SAML 2.0</a></p>
<p>2) Apply the fix outlined in <a href="http://www.john-james-andersen.com/blog/service-now/fixing-sp-initiated-login-with-adfs-2-0-and-servicenow-saml.html" title="Fixing SP Initiated Login with ADFS 2.0 and ServiceNow SAML" target="_blank">Fixing SP Initiated Login with ADFS 2.0 and ServiceNow SAML</a></p>
<p>3) Modify the SAML &#8220;Script Object&#8221; according to these instructions:</p>
<p>Browse to the SAML application in ServiceNow and click on the &#8220;Script Object&#8221; module.<br />
<img src="http://www.john-james-andersen.com/wp-content/uploads/scriptobject.png" alt="" title="scriptobject" width="247" height="187" class="aligncenter size-full wp-image-1262" /></p>
<p>In the script that comes up, find the following line:</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">authnContextClassRef.<span style="color: #660066;">setAuthnContextClassRef</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>Comment out that line and add a new line as seen below:</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #006600; font-style: italic;">//authnContextClassRef.setAuthnContextClassRef(&quot;urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport&quot;);</span><br />
authnContextClassRef.<span style="color: #660066;">setAuthnContextClassRef</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;urn:federation:authentication:windows&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>Then, save the script.</p>
<h1>Disclaimer</h1>
<p>As this is not out of the box code for the ServiceNow SAML 2.0 plugin, it has not been thoroughly tested by a large number of users.  Please use at your own risk.  </p>
<p>Please also understand that by modifying an out-of-the-box script such as this, you will not automatically get future updates applied to this script.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/service-now/supporting-kerberos-authentication-with-adfs-in-servicenow.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Null Prefix with ServiceNow SAML and Siteminder</title>
		<link>http://www.john-james-andersen.com/blog/service-now/null-prefix-with-servicenow-saml-and-siteminder.html</link>
		<comments>http://www.john-james-andersen.com/blog/service-now/null-prefix-with-servicenow-saml-and-siteminder.html#comments</comments>
		<pubDate>Wed, 18 Jan 2012 15:31:35 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Service-Now]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=1244</guid>
		<description><![CDATA[Over the past few months I have had a few ServiceNow customers contact me with errors that they were seeing when using SiteMinder as their SAML federation service. THE ISSUE When their users would perform an Identity Provider (IdP) initiated login, their ServiceNow instance would throw the following error in the system log: java.lang.IllegalArgumentException: prefix [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.john-james-andersen.com/wp-content/uploads/nullimage1.gif"><img src="http://www.john-james-andersen.com/wp-content/uploads/nullimage1.gif" alt="" title="nullimage" width="230" height="232" class="aligncenter size-full wp-image-1245" /></a></p>
<p>Over the past few months I have had a few ServiceNow customers contact me with errors that they were seeing when using SiteMinder as their SAML federation service.  </p>
<h1>THE ISSUE</h1>
<p>When their users would perform an Identity Provider (IdP) initiated login, their ServiceNow instance would throw the following error in the system log:</p>
<blockquote><p>
    java.lang.IllegalArgumentException: prefix cannot be &#8220;null&#8221; when creating a QName<br />
    Caused by error in Script Include: &#8216;SAML2&#8242; at line 41</p>
<p>    38: document.normalizeDocument();<br />
    39: var metadataRoot = document.getDocumentElement();<br />
    40:<br />
    ==> 41: var qName = new QName(metadataRoot.getNamespaceURI(), metadataRoot.getLocalName(), metadataRoot.getPrefix());<br />
    42:
</p></blockquote>
<p>The customers observed that SiteMinder creates a SAML2 Response without any namespace prefix:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &lt;Response xmlns=&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot; …</div></td></tr></tbody></table></div>
<p>When we are typically looking for something like this:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp;&lt;samlp:Response xmlns:samlp=&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot;</div></td></tr></tbody></table></div>
<p>According to the JavaDoc on a Node object, if there is no prefix in an XML document, it will return null.  However, this will conflict with the QName constructor.  According to the QName JavaDoc, if there is no prefix, we need to use a different constructor that omits the prefix altogether.</p>
<h1>PROPOSED SOLUTION</h1>
<blockquote><p><em>New Update:  If you download the update set that provides <a href="http://www.john-james-andersen.com/blog/service-now/servicenow-saml-2-0-additional-configurations-update-set.html" title="Additional SAML 2.0 Options">Additional SAML 2.0 Configuration Options</a> then you will not need to modify the SAML scripts as outlined below. </em></p></blockquote>
<p>Change SAML2 script include (line 41) from:</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> qName <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> QName<span style="color: #009900;">&#40;</span>metadataRoot.<span style="color: #660066;">getNamespaceURI</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> metadataRoot.<span style="color: #660066;">getLocalName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> metadataRoot.<span style="color: #660066;">getPrefix</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>to be:</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> qName <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> metadataRoot.<span style="color: #660066;">getPrefix</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;qName <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> QName<span style="color: #009900;">&#40;</span>metadataRoot.<span style="color: #660066;">getNamespaceURI</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> metadataRoot.<span style="color: #660066;">getLocalName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> metadataRoot.<span style="color: #660066;">getPrefix</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;qName <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> QName<span style="color: #009900;">&#40;</span>metadataRoot.<span style="color: #660066;">getNamespaceURI</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> metadataRoot.<span style="color: #660066;">getLocalName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>This will first detect if there is a prefix on the SAML Response.  If there is not, then it will call the appropriate QName constructor.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/service-now/null-prefix-with-servicenow-saml-and-siteminder.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Possible Fix for ADFS 2.0 SingleLogout with ServiceNow</title>
		<link>http://www.john-james-andersen.com/blog/service-now/possible-fix-for-adfs-2-0-singlelogout-with-servicenow.html</link>
		<comments>http://www.john-james-andersen.com/blog/service-now/possible-fix-for-adfs-2-0-singlelogout-with-servicenow.html#comments</comments>
		<pubDate>Wed, 28 Dec 2011 18:08:45 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Service-Now]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=1223</guid>
		<description><![CDATA[Many ServiceNow/ADFS clients have been having issues with their SAML SingleLogout from their ServiceNow instance to their ADFS Identity Provider (IdP). I recently worked with a talented systems engineer, J Stephen Kowski, who was able to get SingleLogout to work for his company. Here is a quick summary of what changes he did to get [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.john-james-andersen.com/wp-content/uploads/leaving.jpg" alt="SingleLogout with ServiceNow and AD FS" title="SingleLogout with ServiceNow and AD FS" width="225" height="225" class="aligncenter size-full wp-image-1224" /></p>
<p>Many ServiceNow/ADFS clients have been having issues with their SAML SingleLogout from their ServiceNow instance to their ADFS Identity Provider (IdP).</p>
<p>I recently worked with a talented systems engineer, <a href="http://twitter.com/jaytheletterj" title="J Stephen Kowski" target="_blank">J Stephen Kowski</a>, who was able to get SingleLogout to work for his company.</p>
<p>Here is a quick summary of what changes he did to get this to work.</p>
<h2>Customize the SingleLogout URL in ServiceNow</h2>
<p>In the SingleLogout URL property of ServiceNow, change the URL to something like:</p>
<pre>https://s.myIdP.com/adfs/ls/?wa=wsignout1.0&#038;wreply=https://s.myIdP.com/adfs/ls/?wa=wsignoutcleanup1.0</pre>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/slo.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/slo.png" alt="" title="slo" width="709" height="83" class="aligncenter size-full wp-image-1226" /></a></p>
<h2>Customize the AD FS error script</h2>
<p>Modify the file located in your &#8220;adfs/ls/&#8221; directory on your IdP web server.  The file is: &#8220;error.aspx.cs&#8221;.</p>
<p>At the bottom of the file add the following code:</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>Exception.<span style="color: #660066;">Message</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;MSIS7055: Not all SAML session participants<br />
&nbsp; &nbsp; &nbsp; &nbsp; logged out properly. It is recommended to close your browser.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp;Response.<span style="color: #660066;">Redirect</span><span style="color: #009900;">&#40;</span>System.<span style="color: #660066;">Web</span>.<span style="color: #660066;">Configuration</span>.<span style="color: #660066;">WebConfigurationManager</span>.<span style="color: #660066;">AppSettings</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;signoutredirect&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>The above code should handle a common error that has been known to occur between service providers and ADFS.</p>
<h2>Credits</h2>
<p>As mentioned above, the credit for this solution goes to <a href="http://twitter.com/jaytheletterj" title="J Stephen Kowski" target="_blank">J Stephen Kowski</a>.  your results may vary according to your set up and environment, but let me know if it helps.   </p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/service-now/possible-fix-for-adfs-2-0-singlelogout-with-servicenow.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fixing SP Initiated Login with ADFS 2.0 and ServiceNow SAML</title>
		<link>http://www.john-james-andersen.com/blog/service-now/fixing-sp-initiated-login-with-adfs-2-0-and-servicenow-saml.html</link>
		<comments>http://www.john-james-andersen.com/blog/service-now/fixing-sp-initiated-login-with-adfs-2-0-and-servicenow-saml.html#comments</comments>
		<pubDate>Tue, 27 Dec 2011 18:33:15 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Service-Now]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=1215</guid>
		<description><![CDATA[A few months ago I worked with a client to get AD FS 2.0 working with SAML 2.0 in a situation where ServiceNow is the Service Provider. However, at the time, we were unable to get an SP-initiated authentication scenario to work between SeviceNow and AD FS. I recently came across some articles which keyed [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.john-james-andersen.com/wp-content/uploads/knock.jpg"><img src="http://www.john-james-andersen.com/wp-content/uploads/knock.jpg" alt="SAML SP-Initiated Login" title="SP-Initiated Login" width="270" height="175" class="aligncenter size-full wp-image-1216" /></a></p>
<p>A few months ago I worked with a client to get AD FS 2.0 working with SAML 2.0 in a situation where ServiceNow is the Service Provider.  However, at the time, we were unable to get an SP-initiated authentication scenario to work between SeviceNow and AD FS.  </p>
<p>I recently came across some articles which keyed me into a probable cause of the SP-Initiated Authentication failures.</p>
<p>When someone tries to get to their ServiceNow instance in an unauthenticated state by going to their instance url (eg. https://myinstance.service-now.com), they would be redirected to the IdP login page.  During that redirection, ServiceNow sends a SAML AuthnRequest so that the IdP will know how to process the login.</p>
<p>In the request, ServiceNow was sending the following NameID format element:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;saml2p:NameIDPolicy</span> <span style="color: #000066;">AllowCreate</span>=<span style="color: #ff0000;">&quot;true&quot;</span> </span><br />
<span style="color: #009900;"> <span style="color: #000066;">Format</span>=<span style="color: #ff0000;">&quot;urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress&quot;</span></span><br />
<span style="color: #009900;"> <span style="color: #000066;">SPNameQualifier</span>=<span style="color: #ff0000;">&quot;https://myinstance.service-now.com/navpage.do&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></td></tr></tbody></table></div>
<p>AD FS, however was responding that ServiceNow was sending an invalid NameIDPolicy.</p>
<p>After reading the <a href="http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf" title="SAML 2.0 Assertion Specification Document" target="_blank">SAML 2.0 Assertion Specification</a> document, I came across the following text on lines 424-432:</p>
<blockquote><p>
<strong>NameQualifier [Optional]</strong><br />
The security or administrative domain that qualifies the identifier. This attribute provides a means to federate identifiers from disparate user stores without collision.<br />
<strong>SPNameQualifier [Optional]</strong><br />
Further qualifies an identifier with the name of a service provider or affiliation of providers. This attribute provides an additional means to federate identifiers on the basis of the relying party or parties.</p>
<p>The <strong>NameQualifier </strong> and <strong>SPNameQualifier </strong> attributes SHOULD be omitted unless the identifier&#8217;s type definition explicitly defines their use and semantics.
</p></blockquote>
<p>This led me to believe that maybe the SPNameQualifier attribute could be causing errors with AD FS since we are not explicitly defining the use and semantics.</p>
<h1>The Solution</h1>
<blockquote><p><em>New Update:  If you download the update set that provides <a href="http://www.john-james-andersen.com/blog/service-now/servicenow-saml-2-0-additional-configurations-update-set.html" title="Additional SAML 2.0 Options">Additional SAML 2.0 Configuration Options</a> then you will not need to modify the SAML scripts as outlined below. You only need to change the properties on the SAML Properties page.</em></p></blockquote>
<p>To fix this issue, I visited the &#8220;SAML2&#8243; Script Include and commented out two lines of code where we set the SPNameQualifier in the SAMLRequest.  </p>
<p>In the &#8220;createNameID&#8221; function I commented out the following line:</p>
<pre>//nid.setSPNameQualifier(serviceURL);</pre>
<p>In the &#8220;createNameIDPolicy&#8221; function I commented out the following:</p>
<pre>//nameIdPolicy.setSPNameQualifier(serviceURLStr);</pre>
<p>Once I had saved this library I was able to perform an SP-initiated SAML authentication between ServiceNow and AD FS 2.0.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/service-now/fixing-sp-initiated-login-with-adfs-2-0-and-servicenow-saml.html/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Logout or Cancel Errors with ServiceNow SAML</title>
		<link>http://www.john-james-andersen.com/blog/service-now/logout-or-cancel-errors-with-servicenow-saml.html</link>
		<comments>http://www.john-james-andersen.com/blog/service-now/logout-or-cancel-errors-with-servicenow-saml.html#comments</comments>
		<pubDate>Thu, 22 Dec 2011 17:53:58 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Service-Now]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=1209</guid>
		<description><![CDATA[Some of my clients have come across an issue with ServiceNow and SAML 2.0. If they perform a successful SingleLogout in SAML, or they cancel out of their SAML login process, they are often returned to the main ServiceNow local login page with an error displayed in red at the top of the page saying: [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.john-james-andersen.com/wp-content/uploads/ErrorOnLogout.png" alt="" title="ErrorOnLogout" width="480" height="254" class="aligncenter size-full wp-image-1210" /></p>
<p>Some of my clients have come across an issue with ServiceNow and SAML 2.0.  If they perform a successful SingleLogout in SAML, or they cancel out of their SAML login process, they are often returned to the main ServiceNow local login page with an error displayed in red at the top of the page saying:</p>
<blockquote><p>Could not extract //Subject/NameID from SAMLResponse</p></blockquote>
<p>I believe this is related to some changes that happened in the June 2011 release with regard to public pages in ServiceNow.  The good news is that with a few configuration steps, you can have the browser redirect the user to a specific URL in these events so as to avoid this page and the display of the associated error.</p>
<p>Follow these simple instructions&#8230;</p>
<p>In your instance, go to the “Single Sign-on” module under the “System Properties” application.</p>
<p>Set the following fields:</p>
<ul>
<li>When a user attempts to access a page that is private (to view an incident, etc) and SSO credentials are not present, they will be redirected to the URL specified in this property. This is typically set to a customer&#8217;s login portal (e.g. http://portal.companya.com):</li>
<li>When set to true requires SSO credentials even for the main Service-now login page. Defaults to false. This property needs to be used in conjunction with the &#8216;glide.authenticate.failed_requirement_redirect&#8217; property.</li>
</ul>
<p>They will be displayed something like this:</p>
<p><img src="http://www.john-james-andersen.com/wp-content/uploads/sso-error-redirect.png" alt="Single Sign On Redirection Properties" title="Single Sign On Redirection Properties" width="596" height="347" class="aligncenter size-full wp-image-1211" /></p>
<ol>
<li>In the first field, put the URL where you would like to redirect the user after they click Cancel.  </li>
<li>In the bottom property, make sure you type “true” and that will force the page to go to that URL when we come across and error such as the cancel.</li>
</ol>
<p>Give is a few test runs to make sure everything works as you would expect and then you are good to go!</p>
<p>If you implement these settings, let me know how it works for you.  I haven&#8217;t been able to test it in many scenarios, so I would like to know if there are any gotchas associated with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/service-now/logout-or-cancel-errors-with-servicenow-saml.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bust out of those Frames</title>
		<link>http://www.john-james-andersen.com/blog/programming/bust-out-of-those-frames.html</link>
		<comments>http://www.john-james-andersen.com/blog/programming/bust-out-of-those-frames.html#comments</comments>
		<pubDate>Fri, 16 Dec 2011 18:16:36 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Service-Now]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=1203</guid>
		<description><![CDATA[Because ServiceNow is a framed application, I often get asked by customers how to deal with any potential nested frame issues. There are many ways to handle this, but often times it boils down to just inserting frame-busting javascript code in the right place. An HTML document with the following javascript code snippet will detect [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.john-james-andersen.com/wp-content/uploads/sledge.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/sledge.png" alt="" title="sledge" width="312" height="258" class="aligncenter size-full wp-image-1204" /></a></p>
<p>Because ServiceNow is a framed application, I often get asked by customers how to deal with any potential nested frame issues.</p>
<p>There are many ways to handle this, but often times it boils down to just inserting frame-busting javascript code in the right place.</p>
<p>An HTML document with the following javascript code snippet will detect if it is being displayed within a frame as it loads.  If it is, it will break out of the frame and show that page as the main document in the browser.</p>
<p>Here is the code:</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>top <span style="color: #339933;">!=</span> self<span style="color: #009900;">&#41;</span> top.<span style="color: #660066;">location</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span>location<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<p>This code snippet is designed to go within the BODY of the HTML document.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/programming/bust-out-of-those-frames.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial: SOAP into ServiceNow via x509 WS-Security</title>
		<link>http://www.john-james-andersen.com/blog/service-now/tutorial-soap-into-servicenow-via-x509-ws-security.html</link>
		<comments>http://www.john-james-andersen.com/blog/service-now/tutorial-soap-into-servicenow-via-x509-ws-security.html#comments</comments>
		<pubDate>Tue, 22 Nov 2011 21:25:57 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Service-Now]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=1149</guid>
		<description><![CDATA[Recently, ServiceNow added inbound WS-Security profiles as a SOAP interface option into the system. I have had several customers ask how this works, so I have created the following tutorial. This article will demonstrate how to set up a self-signed certificate, generate a SOAP client that utilizes the certificate, and configure a ServiceNow instance to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.john-james-andersen.com/wp-content/uploads/certauth.jpg"><img src="http://www.john-james-andersen.com/wp-content/uploads/certauth.jpg" alt="" title="certauth" width="400" height="259" class="aligncenter size-full wp-image-1150" /></a></p>
<p>Recently, ServiceNow added inbound WS-Security profiles as a SOAP interface option into the system.  I have had several customers ask how this works, so I have created the following tutorial.</p>
<p>This article will demonstrate how to set up a self-signed certificate, generate a SOAP client that utilizes the certificate, and configure a ServiceNow instance to accept SOAP communication using the x509 Certificate WS-Security profile.</p>
<h1>Create a self-signed certificate</h1>
<p>The idea behind the x509 WS-Security profile is that you can sign your SOAP request and provide a key that a service can use to verify that the data in the SOAP request has not been tampered with.  Typically, you would go through a certificate company to sign your certificates for third party consumption, but for testing, it is perfectly valid to generate your own certificate and sign it yourself.  </p>
<p>Since many of my clients use Windows, we will create our self-signed certificate from a windows box.  To do this, you need to make sure you have Java installed somewhere on your machine, and that the Java &#8220;bin&#8221; directory is in your PATH.</p>
<p>In a command shell, you can create and sign a certificate in one fail swoop by issuing the following command:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">keytool <span style="color: #660033;">-genkey</span> <br />
<span style="color: #660033;">-keyalg</span> RSA <br />
<span style="color: #660033;">-alias</span> YOURALIAS <br />
<span style="color: #660033;">-keystore</span> YOURDESTKEYSTOREFILE <br />
<span style="color: #660033;">-storepass</span> YOURDESIREDKEYSTOREPASSWORD <br />
<span style="color: #660033;">-validity</span> NUMBEROFDAYSYOURCERTSHOULDBEVALID <br />
<span style="color: #660033;">-keysize</span> <span style="color: #000000;">2048</span></div></td></tr></tbody></table></div>
<p>When you execute this command, the system will ask you some questions which you just fill in with arbitrary values.  This is what it looked like for me:</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/keytool1.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/keytool1.png" alt="" title="keytool1" width="660" height="256" class="aligncenter size-full wp-image-1154" /></a></p>
<p>This created a keystore file named:  keystore.jks.  It is a Java keystore that contains my new certificate and the public and private keys.</p>
<p>Down the road, I am going to need to store that certificate into ServiceNow in PEM format.  So, right now I can make another &#8220;keytool&#8221; call to extract the certificate from the keystore and save it in PEM format:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">keytool <span style="color: #660033;">-exportcert</span> <br />
<span style="color: #660033;">-alias</span> ALIASFORYOURCERTIFICATEINKEYSTORE<br />
<span style="color: #660033;">-keypass</span> YOURKEYPASSWORD<br />
<span style="color: #660033;">-keystore</span> SRCKEYSTOREFILENAME<br />
<span style="color: #660033;">-storepass</span> KEYSTOREPASSWORD<br />
<span style="color: #660033;">-rfc</span><br />
<span style="color: #660033;">-file</span> DESTPEMFILENAME</div></td></tr></tbody></table></div>
<p>This will create a file with a .pem extension that contains your certificate in PEM format.  Here is what it looked like for me:</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/keytool2.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/keytool2.png" alt="" title="keytool2" width="649" height="436" class="aligncenter size-full wp-image-1157" /></a></p>
<h1>Set up SOAP-UI</h1>
<p>For this tutorial, our SOAP client will be the free SOAP utility:  SOAP-UI.</p>
<p>I first loaded my &#8220;incident&#8221; WSDL into SOAP-UI to create a new project. </p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/newSUIProj.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/newSUIProj.png" alt="" title="newSUIProj" width="604" height="354" class="aligncenter size-full wp-image-1160" /></a></p>
<p>Once the project is created, you want to double click on the project itself to view the properties.</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/projprops1.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/projprops1.png" alt="" title="projprops1" width="667" height="278" class="aligncenter size-full wp-image-1161" /></a></p>
<p>On the project properties dialog, you will click the WS-Security Configurations tab, and then click on the &#8220;Keystores/Certificates&#8221; subtab.  In the sub-panel that appears, you will want to click the &#8220;Add&#8221; icon to add the keystore that we created earlier.</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/projprops2.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/projprops2.png" alt="" title="projprops2" width="625" height="272" class="aligncenter size-full wp-image-1162" /></a></p>
<p>Browse to the keystore file that we created and select it and click the &#8220;Open&#8221; button.</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/selectKeystore.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/selectKeystore.png" alt="" title="selectKeystore" width="555" height="408" class="aligncenter size-full wp-image-1163" /></a></p>
<p>When SOAP-UI attempts to open your file, you will need to enter in the keystore password.  Use the password that you entered earlier for the keystore.</p>
<p>Once you have completed this, your keystore should be listed in the Keystores/Certificates list.  Make sure that your &#8220;Status&#8221; field is &#8220;OK&#8221;.  If there was a problem loading your keystore, you will see an error there.</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/keystoreloaded.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/keystoreloaded.png" alt="" title="keystoreloaded" width="596" height="217" class="aligncenter size-full wp-image-1164" /></a></p>
<p>Now that we have loaded our keystore, we need to create an &#8220;Ountgoing WS-Security Configuration&#8221; profile that will leverage our keystore. </p>
<p>To do this, click on the &#8220;Outgoing WS-Security Configurations&#8221; subtab on the project properties dialog, and then click the &#8220;Add&#8221; icon.  You will be prompted to provide a name for your configuration.  You can name it anything as long as it is unique to the project.</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/outboundConfig.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/outboundConfig.png" alt="" title="outboundConfig" width="504" height="318" class="aligncenter size-full wp-image-1166" /></a></p>
<p>Once you have created your configuration, you will need to click the &#8220;Add&#8221; icon in the lower pane to add the types of security your request will employ.  You will want to select &#8220;Signature&#8221; since we will be signing our SOAP Request.</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/choosesign.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/choosesign.png" alt="" title="choosesign" width="474" height="320" class="aligncenter size-full wp-image-1169" /></a></p>
<p>Now you should see the settings for signing a SOAP request.  Select your keystore file name, the alias that contains your certificate &#038; keys, and your keystore password.  Make the Key Identifier type be: x509 Certificate.  Use the RSA-SHA1 signing algorithm with the xml-exc-c14n canonicalization.  Also, select the SHA1 digest algorithm. </p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/sigdetails.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/sigdetails.png" alt="" title="sigdetails" width="586" height="324" class="aligncenter size-full wp-image-1170" /></a></p>
<h1>Configure ServiceNow Instance</h1>
<p>Now that our client is setup with our keystore, we need to configure ServiceNow to accept SOAP requests using the x509 WS-Security profile.</p>
<p>First we need to load the certificate that will be used by SOAP-UI to sign the request.  If you recall, we created a PEM version of the certificate just after we created the keystore file.  You will want to copy the contents (PEM String) from that file and copy it into a new Certificate record in ServiceNow.  Then click the &#8220;Submit&#8221; button.</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/gotocert.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/gotocert.png" alt="" title="gotocert" width="517" height="212" class="aligncenter size-full wp-image-1171" /></a></p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/creatingcertrec.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/creatingcertrec.png" alt="" title="creatingcertrec" width="664" height="406" class="aligncenter size-full wp-image-1172" /></a></p>
<p>Once you have done this, your certificate record should be listed with any other certificates you may have loaded into your instance.</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/certlist.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/certlist.png" alt="" title="certlist" width="572" height="130" class="aligncenter size-full wp-image-1173" /></a></p>
<p>Now we need to set up a WS-Security profile in ServiceNow to accept and validate x509 signed SOAP requests.</p>
<p>Browse to the &#8220;WS Security Profiles&#8221; module inside of the &#8220;System Web Services&#8221; application.  Once you are there, create a New profile by clicking on the new button.</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/gotowssec.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/gotowssec.png" alt="" title="gotowssec" width="496" height="171" class="aligncenter size-full wp-image-1174" /></a></p>
<p>From here you select the x509 profile and select the user you would like this profile to execute as with the SOAP action.  You will also need to select the Certificate record we just created so that we can validate the signature.</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/wssec.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/wssec.png" alt="" title="wssec" width="580" height="123" class="aligncenter size-full wp-image-1175" /></a></p>
<p>You may wish to restrict all SOAP requests to use WS-Security when they come into your instance.  If you choose to do so, you will need to select the setting found in the &#8220;Properties&#8221; module of the &#8220;System Web Services&#8221; application that enforces WS Security for inbound SOAP requests.</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/requirews.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/requirews.png" alt="" title="requirews" width="558" height="201" class="aligncenter size-full wp-image-1176" /></a></p>
<p>Your instance is now configured to accept signed SOAP requests with an x509 token.</p>
<h1>Test your setup</h1>
<p>In order to test this, we go back to our SOAP UI project and create a Request on the &#8220;getRecords&#8221; web service function.</p>
<p>We are going to request three active incident records using the following XML:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soapenv:Envelope</span> <span style="color: #000066;">xmlns:soapenv</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;</span> <span style="color: #000066;">xmlns:inc</span>=<span style="color: #ff0000;">&quot;http://www.service-now.com/incident&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soapenv:Header</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soapenv:Body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;inc:getRecords<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;inc:active<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/inc:active<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;inc:__limit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>3<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/inc:__limit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/inc:getRecords<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soapenv:Body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soapenv:Envelope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>We will paste that XML into the request window.  Then click on the &#8220;Aut&#8221; button at the bottom of the request dialog box in SOAP-UI.  There you will need to enter your basic authentication credentials.  (At this point in time ServiceNow requires that you use BasicAuth in conjunction with a WS-Security profile).  Finally, select the Outbound WS Security configuration that we created earlier.</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/createrequest.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/createrequest.png" alt="" title="createrequest" width="581" height="498" class="aligncenter size-full wp-image-1177" /></a></p>
<p>Once you submit your request through SOAP-UI, you should successfully connect, authenticate, and receive the response you requested:</p>
<p><a href="http://www.john-james-andersen.com/wp-content/uploads/response.png"><img src="http://www.john-james-andersen.com/wp-content/uploads/response.png" alt="" title="response" width="422" height="323" class="aligncenter size-full wp-image-1178" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/service-now/tutorial-soap-into-servicenow-via-x509-ws-security.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Correcting Misguided SOAP Endpoints in ServiceNow</title>
		<link>http://www.john-james-andersen.com/blog/service-now/correcting-misguided-soap-endpoints-in-servicenow.html</link>
		<comments>http://www.john-james-andersen.com/blog/service-now/correcting-misguided-soap-endpoints-in-servicenow.html#comments</comments>
		<pubDate>Mon, 21 Nov 2011 19:10:39 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Service-Now]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=1144</guid>
		<description><![CDATA[I recently worked with a colleague on an issue that he was seeing when trying to connect into a ServiceNow instance via SOAP. He would import the WSDL file into SOAP-UI or any other SOAP client using a WSDL URL similar to: https://myinstance.service-now.com/mytable.do?WSDL The WSDL would import properly and load up all of the available [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.john-james-andersen.com/wp-content/uploads/preacher-300x276.png" alt="" title="preacher" width="300" height="276" class="aligncenter size-medium wp-image-1145" /></p>
<p>I recently worked with a colleague on an issue that he was seeing when trying to connect into a ServiceNow instance via SOAP.  </p>
<p>He would import the WSDL file into SOAP-UI or any other SOAP client using a WSDL URL similar to:</p>
<p>https://myinstance.service-now.com/mytable.do?WSDL</p>
<p>The WSDL would import properly and load up all of the available SOAP functions.  However, when he would try to execute one of the functions, he would get the following response (trimmed down a bit for this article):</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Apache Tomcat/7.0.16 - Error report<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>HTTP Status 401 - <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;HR</span> <span style="color: #000066;">size</span>=\<span style="color: #ff0000;">&quot;1\&quot;</span> <span style="color: #000066;">noshade</span>=\<span style="color: #ff0000;">&quot;noshade\&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;b<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>type<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/b<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> Status report<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;b<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>message<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/b<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;u<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/u<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;b<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>description<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/b<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;u<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>This request requires HTTP authentication ().<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/u<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;HR</span> <span style="color: #000066;">size</span>=\<span style="color: #ff0000;">&quot;1\&quot;</span> <span style="color: #000066;">noshade</span>=\<span style="color: #ff0000;">&quot;noshade\&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h3<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Apache Tomcat/7.0.16<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h3<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>The user was including the proper authentication credentials and we were able to verify that those credentials had the necessary roles.  However, something was still amiss.</p>
<p>After careful observation, we noticed that the WSDL was stating that the SOAP Endpoint was available via &#8220;HTTP&#8221; instead of &#8220;HTTPS&#8221;.  This was due to a misconfiguration one a switch in one of the data centers.</p>
<p>There were two ways the customer could immediately fix this issue so that they could move on with their integration without having to wait for support to manage the issue.</p>
<p>1) They could manually change the endpoint in their SOAP client to be HTTPS instead of HTTP.  However, they would need to do this for every SOAP client that was connecting into their instance.  Not necessarily the best route to take if they have many integrations.</p>
<p>2) They could create (or set) the following property with their base url as instructed by the <a href="http://wiki.service-now.com/index.php?title=SOAP_Web_Service#Overriding_the_SOAP_Endpoint" target="_blank">wiki</a>:</p>
<blockquote><p>com.glide.soap_address_base_url</p></blockquote>
<p>Once either of these solutions were implemented, the customer was once again up and running.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/service-now/correcting-misguided-soap-endpoints-in-servicenow.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring ServiceNow for SAML 2.0</title>
		<link>http://www.john-james-andersen.com/blog/service-now/configuring-servicenow-for-saml-2-0.html</link>
		<comments>http://www.john-james-andersen.com/blog/service-now/configuring-servicenow-for-saml-2-0.html#comments</comments>
		<pubDate>Wed, 16 Nov 2011 13:51:47 +0000</pubDate>
		<dc:creator>John Andersen</dc:creator>
				<category><![CDATA[Service-Now]]></category>

		<guid isPermaLink="false">http://www.john-james-andersen.com/?p=1138</guid>
		<description><![CDATA[I have had a lot of people come to me with questions on where to get started with their SAML 2.0 Single Sign-on plugin. In order to help people out a little quicker, I have created a video that demonstrates the steps that are required to take in order to set up the SAML 2.0 [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.john-james-andersen.com/wp-content/uploads/Slide1-300x225.jpg" alt="SAML 2.0 Demo" title="SAML 2.0 Demo" width="300" height="225" class="aligncenter size-medium wp-image-1139" /></p>
<p>I have had a lot of people come to me with questions on where to get started with their SAML 2.0 Single Sign-on plugin.  </p>
<p>In order to help people out a little quicker, I have created a video that demonstrates the steps that are required to take in order to set up the SAML 2.0 plugin in ServiceNow with SSOCircle.com, a free, public Identity Provider (IdP).</p>
<p>While companies will not typically use <a href="http://www.ssocircle.com" title="SSOCircle" target="_blank">SSOCircle.com</a> as their identity provider, it allows me to demonstrate the basic steps that an individual would need to take in order to set up their ServiceNow instance with their own IdP.</p>
<p><iframe width="420" height="315" src="http://www.youtube.com/embed/bk-gCYfNVT8" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.john-james-andersen.com/blog/service-now/configuring-servicenow-for-saml-2-0.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
