Browsing ยป Programming

Quick tip for ignoring namespaces with XPath

Quick tip for ignoring namespaces with XPath

I often have to parse an XML Document to pull out element text when doing an integration with a third party system. I have used XPATH for these types of queries for years, but have always cringed when there were a lot of namespace declarations and prefixes used in the elements. Half of the time, […]

Handling UTF8 Characters in ServiceNow Perl API

Handling UTF8 Characters in ServiceNow Perl API

Someone recently asked me how to send Japanese characters as field values to an incident when using the ServiceNow Perl API. I created a script based off of examples in the ServiceNow Perl API documentation and found that my field value was converted to a Base64 string by the time it arrived into ServiceNow. I […]

Bust out of those Frames

Bust out of those Frames

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 […]

Javascript: When in doubt, don’t Replace

Javascript: When in doubt, don’t Replace

I ran into situation the other day where I had been doing a Javascript “Replace” function on a string of text. The Javascript replace looked intriguing because I could use a regular expression and have it replaced with a give string through an entire text. The product requirements insisted that this would only be a […]

Creating files of a specific size in Windows

Creating files of a specific size in Windows

The other day I needed to do some testing with files of a very specific size. I was on a Windows PC that day, so I needed to find a tool that would work on a windows machine. I originally had thought to give it a spin in Python or Perl, but before I got […]

Pulling out groups from javascript Regular Expressions

Pulling out groups from javascript Regular Expressions

I use this a lot and I always have to look it up. I decided to blog it so that I don’t have to search every time I need to use Regular Expression Grouping to grab information from a string. Let’s say that I have a string that I need to pull some data out […]

Sample SAML 2.0 AuthnRequest in Java

Sample SAML 2.0 AuthnRequest in Java

Playing around with SAML 2.0 some more. Here is some code that I created that allowed me to create a SAML 2.0 AuthnRequest object to be submitted to an Identity Provider. 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122public String buildAuthnRequest(){     try {             XMLObjectBuilderFactory builderFactory = org.opensaml.Configuration.getBuilderFactory();             //Generate […]

Stepping Through a SAML2.0 Authentication Process

Stepping Through a SAML2.0 Authentication Process

I recently created a SAML 2.0 Service Provider using PHP. I used the AuthnRequest Protocol with HTTP-POST binding. This was done to help me understand the basic SAML 2.0 exchanges between a Service Provider and an Identity Provider. Here is an exhaustive analysis of my Service Provider logs that I created. The service provider that […]

Converting Date Strings to Javascript Dates

Converting Date Strings to Javascript Dates

Javascript does have a good Date object that can be used to manipulate dates in your script. Another benefit it sports is that it can take several string formats and create a Date object from that string. However, despite their efforts to use the most common strings you will likely come across a date format […]

Great SAML Decode/Encode Tool

Great SAML Decode/Encode Tool

I have been struggling for the past few days trying to get my Java program to properly build and encode a SAML 2.0 Authentication Request that should initiate a Single Sign-on event with a SAML 2.0 capable Identity Provider. I was having problems with the Java library that I was using to DEFLATE the authentication […]

« Previous Entries

47 queries. 1.305 seconds