Passer au contenu principal
GET
https://{tenantDomain}/api/v2
/
user-blocks
/
{id}
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;

public partial class Examples
{
    public async Task Example() {
        var client = new ManagementClient(
            token: "<token>"
        );

        await client.UserBlocks.ListAsync(
            id: "id",
            request: new ListUserBlocksRequestParameters {
                ConsiderBruteForceEnablement = true
            }
        );
    }

}
package example

import (
context "context"

management "github.com/auth0/go-auth0/management/management"
client "github.com/auth0/go-auth0/management/management/client"
option "github.com/auth0/go-auth0/management/management/option"
)

func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &management.ListUserBlocksRequestParameters{
ConsiderBruteForceEnablement: management.Bool(
true,
),
}
client.UserBlocks.List(
context.TODO(),
"id",
request,
)
}
package com.example.usage;

import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.resources.userblocks.requests.ListUserBlocksRequestParameters;

public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.token("<token>")
.build();

client.userBlocks().list(
"id",
ListUserBlocksRequestParameters
.builder()
.considerBruteForceEnablement(true)
.build()
);
}
}
<?php

namespace Example;

use Auth0\SDK\API\Management\Management;
use Auth0\SDK\API\Management\UserBlocks\Requests\ListUserBlocksRequestParameters;

$client = new Management(
token: '<token>',
);
$client->userBlocks->list(
'id',
new ListUserBlocksRequestParameters([
'considerBruteForceEnablement' => true,
]),
);
from auth0.management import ManagementClient

client = ManagementClient(
token="<token>",
)

client.user_blocks.list(
id="id",
consider_brute_force_enablement=True,
)
require "auth0"

client = Auth0::Management.new(token: "<token>")

client.user_blocks.list(
id: "id",
consider_brute_force_enablement: true
)
import { ManagementClient } from "auth0";

async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.userBlocks.list("id", {
considerBruteForceEnablement: true,
});
}
main();
import { ManagementClient } from "auth0";

async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.userBlocks.list("id", {
considerBruteForceEnablement: true,
});
}
main();
curl --request GET \
--url https://{tenantDomain}/api/v2/user-blocks/{id} \
--header 'Authorization: Bearer <token>'
{
  "blocked_for": [
    {
      "identifier": "john.doe@gmail.com",
      "ip": "10.0.0.1",
      "connection": "<string>"
    }
  ]
}

Autorisations

Authorization
string
header
requis

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Paramètres de chemin

id
string
requis

user_id of the user blocks to retrieve.

Paramètres de requête

consider_brute_force_enablement
boolean
If true and Brute Force Protection is enabled and configured to block logins, will return a list of blocked IP addresses.
If true and Brute Force Protection is disabled, will return an empty list.

Réponse

User block successfully retrieved.

blocked_for
object[]

Array of identifier + IP address pairs. IP address is optional, and may be omitted in certain circumstances (such as Account Lockout mode).