Python SDK Mgmt API Example Doesn't Work

I am trying to get the python Mgmt API example to work for my domain/m2m app.

The domain, client id and client secret are all set correctly for the M2M app and Client Credentials is a Grant Type. Yet, when the code below tries to list the users, it returns an error saying bad token. The token is obtained from Auth0

    domain = os.environ['AUTH0_DOMAIN']
    client_id = os.environ['AUTH0_CLIENTID']
    client_secret = os.environ['AUTH0_CLIENTSECRET']

    get_token = GetToken(domain, client_id, client_secret=client_secret)
    token = get_token.client_credentials('https://{}/api/v2/'.format(domain))
    auth0 = Auth0(domain, token['access_token'])

    users = auth0.users.list()

auth0.exceptions.Auth0Error: 401: Invalid token

Any ideas?

I found the problem. I have to go into the Mgmt API settings and authorize all the permissions for the M2M app.