PaginationToken for Conito IDp ListUsers Action
While creating an API using the APIGateway's AWS service(Cognito IDp) to ListUsers in User Pool I'm facing some issues with the PaginationToken Request Parameter. The document provided by AWS states that the paginationtoken is not a mandatory parameter but even when I pass an empty String as an input i get:
"2 validation errors detected: Value '' at 'paginationToken' failed to satisfy constraint: Member must satisfy regular expression pattern: [\S]+;Value '' at 'paginationToken' failed to satisfy constraint: Member must have length greater than or equal to 1"
I need to know what value this Input Parameter is asking.
I might be misunderstanding as I can't see how API Gateway relates, but the Cognito API's "ListUsers" documentation https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_ListUsers.html says PaginationToken is "An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list" and is optional. The idea is you don't provide it on your first call - you exclude it entirely, you don't pass an empty String. The idiom I use for pagination, which is common in the AWS APIs though a bit inconsistent, is as follows (this is a pseudocode/Python example but the same idea works for all SDKs):
response = some_aws_api(your_params)
while True:
process the response
# check if there's more to retrieve
token = response.get('PaginationToken', '')
if token == '':
break
response = some_aws_api(PaginationToken=token, your_params)
Relevant questions
Where can I find additional logging related to OIDC flow in Cognito
asked 5 months agoCognito IdP: Include "nonce" token in "id_token"
asked 2 months agoExternal IDP Tokens in Cognito User Pools
asked 2 months agoCan I register an IDP with multiple certificates on AWS IAM
asked 2 years agoPaginationToken for Conito IDp ListUsers Action
asked 19 days agoGetting an error logging in with IdP in authorization code grant flow
asked 3 years agoUser pool third-party OIDC - token request
Accepted Answerasked 5 months agoAWS SSO SCIM API pagination for methods
asked 5 months agoAWS CLI & Cognito : Able to list user details but unable to list all users
asked a year agodeny access to a specific idp provider while creating an iam role
asked 6 days ago