GET /users/{userId}/authentication-methods – Retrieves all authentication methods for a user.


Headers:

  • Authorization: Bearer <access_token> (required)
  • Content-Type: application/json or application/x-www-form-urlencoded (required)

Body:

  • None

Path Parameters:

  • userId: The user ID of which user to retrieve authentication methods for (required)

Query Parameters:

  • provider: The authentication provider (optional). Defaults to auth0-user.
  • userPoolId: The Cognito user pool ID (required for Cognito)

  • 200 OK – Returns the user's authentication methods (see examples for provider-specific responses).

Status Code Meaning When it Happens
400 Bad Request Missing or invalid fields in request body
401 Unauthorized Missing or invalid authentication token
404 Not Found Specified user does not exist
500 Internal Server Error Unexpected error during user auth methods retrieval
{
"error": "Detailed error message here"
}

GET /users/exampleUserId/authentication-methods
{
authenticators: {
"id": "authenticator_id",
"type": "authenticator_type",
"confirmed": boolean,
"name": "authenticator_name",
"authenticationMethods": {
"id": "method_id",
"type": "method_type",
}[],
"preferredAuthenticationMethod": string,
"linkId": string,
"phoneNumber": string,
"email": string,
"keyId": string,
"publicKey": string,
"createdAt": string,
"enrolledAt": string,
"lastAuthAt": string,
"credentialDeviceType": string,
"credentialBackedUp": boolean,
"identityUserId": string,
"userAgent": string,
}[],
}
GET /users/exampleUserId/authentication-methods?userPoolId=us-east-1_1234test&provider=cognito-user
{
"authenticators": {
"preferredAuthenticationMethod": string | null,
"authenticationMethods": {@link AuthMethod[]},
"availableMethods": {
"softwareToken": boolean,
"SMS": boolean,
},
}

  • Parameters

    • event: APIGatewayProxyEvent

      The API Gateway event containing the request.

    • context: Context
    • callback: Callback<APIGatewayProxyResult>

    Returns void | Promise<APIGatewayProxyResult>

    A Promise resolving to an API Gateway-compatible response.