Pass credentials to JSON serializer before writing out to JSON.