security: Make getDefaultIdentity raise an exception if the default identity is not set.