def get_user_info(remote):
    """Get user information from Globus.

    See the docs here for v2/oauth/userinfo:
    https://docs.globus.org/api/auth/reference/
    """
    response = remote.get(GLOBUS_USER_INFO_URL)
    user_info = get_dict_from_response(response)
    response.data['username'] = response.data['preferred_username']
    if '@' in response.data['username']:
        user_info['username'], _ = response.data['username'].split('@')
    return user_info