After thinking about it for a bit, I think I'd prefer to create a `GTCredentialProvider` class which implements this behavior. Instances could be created using a block of this type, or subclassed for additional behavior, etc.

That strikes me as the more Cocoa-ish way to do it.