If you write an advanced authentication extension, you need to return IsValidKey. There really isn't a simple way to determine if the key is valid - we've added a method to do this that will be available in the next release.
However it sounds like the simple authentication extension is all you require, and you don't need to compare keys there.