auth0 / node-auth0

Node.js client library for the Auth0 platform.
MIT License
628 stars 307 forks source link

Library is paging by default on /get/connections even though API does not have paging enabled by default #950

Closed kopernic-pl closed 10 months ago

kopernic-pl commented 11 months ago

Checklist

Description

Our Auth0 tenant has quite a lot of OIDC enterprise connections (hundreds).

We were inspired by the Management API doc to believe that get connections does not page results by default (https://auth0.com/docs/api/management/v2/connections/get-connections).

But when using node-auth0 library, results are paged by default source code doc.

Reproduction

  1. Create a lot of OIDC enterprise connections
  2. issue fetchOIDCConnections = () => { return this.client().then(client => client.connections.getAll({strategy: 'oidc'})); };
  3. Expected: all connections; received: only first page of connections.

Additional context

No response

node-auth0 version

"auth0": "3.7.1"

Node.js version

16.x in AWS Lambda runtime

adamjmcgrath commented 11 months ago

Hi @kopernic-pl - thanks for raising this.

Requests to Management API v2 endpoints return a maximum of 50 items, so I suspect this is the limit you're hitting. In order to request more items you have to use pagination - either offset or checkpoint (for more than 1000 connections).

There are examples of both of those here:

kopernic-pl commented 11 months ago

Is this limit on Management API itself?

adamjmcgrath commented 11 months ago

Is this limit on Management API itself?

Correct

if this is the case, then A0 mgmt API doc needs a fix.

This is the best place for product feedback https://auth0.com/feedback

I really missed the doc/info about paging/limits behavior in client

Which doc was this? Perhaps we can make it available again

adamjmcgrath commented 10 months ago

Closing as I believe https://github.com/auth0/node-auth0/issues/950#issuecomment-1752578920 answers your question