Extracted from Persona-Auth