Monday, July 13, 2009

PySAML - A SAML 2.0 Toolkit for Python

Security Assertion Markup Language (SAML) can be a bit confusing to understand. At its core SAML is just a protocol with defined messages written in XML. The main purpose of SAML is to enable you to log in at one place such as a website and then jump over to another website without having to log in again. This setup is commonly called "federation".

It is similiar to OAuth. I see SAML continuing to make headroom in the enterprise space while OAuth stays strong in the consumer space. However in the future I hope these two technologies will end up playing well together.

In either case I am releasing a small Python library for generating SAML assertions. The main purpose of this is to learn SAML by doing (actually having to create an assertion gives me a good idea of the complexity of the protocol).

The library depends on M2Crypto so download and install it:
http://chandlerproject.org/bin/view/Projects/MeTooCrypto

M2Crypto depends on SWIG so you might need that as well.

Once that is installed you can download my distribution of PySAML here:

Python 2.6 - Win32:
http://darkeneddesire.com/PySAML/PySAML-1.0.win32.exe

Unix (source):
http://darkeneddesire.com/PySAML/PySAML.tar.gz

For windows you just run the executable. For unix you should run the following commands:

# cd PySAML
# python setup.py build
# python setup.by install

There are examples in the "examples" folder if you download the full source.

The whole project is available on github as well:
http://github.com/tachang/PySAML/tree/master

Thursday, July 9, 2009

Trying to get Dual-SIM to work in T-Mobile G1

There is a product being sold called "Magic SIM".

http://www.magicsim.com/en/dual_sim_show.asp?id=49&cp_id=&sort2name=14

Basically it is a SIM card that has two slots and a small memory chip. After physically cutting up your two SIM cards and putting them into the slots you insert the whole thing into your phone.

If your phone supports the GSM STK (SIM Tool Kit) standard then you can switch back and forth between the two SIM cards.

However for your phone to actually support the standard the manufacturer had to have built it into the operating system as well as provide a tool to "talk" using the STK.

I currently see that the Android development tree has some Stk development going on. I downloaded a precompiled Stk.apk and installed it on my phone with the card. However it does not seem to work.

While I do see the SIM Toolkit menu icon and it does seem to read from the custom card I am unable to obtain a carrier signal from either of my SIM cards. When I scroll to any of the menu options such as "SIM 1" or "SIM 2" and press the trackball the phone simply gives me a rotating circle on the upper right saying it is busy. And at that point it hangs.

Here is a quick and dirty image of my phone as well as what the SIM menu looks like: