Reject the getMetadata call when principal is undefined