Yes it is possible. However, you need to use Auth0 Management Token.
See this example. I wrote where I do a search (in this case, filtering to get a specific user account, not all users).
. read:users read:user_idp_tokens .
, Postman, , Java. , OkHttpClient
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.2.0</version>
</dependency>
, Postman generate , . Auth0 API Java, .
Update:
, ( URL-).
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;
import java.io.IOException;
public class GetUsers {
public static void main(String[] args) throws IOException {
final String MANAGEMENT_TOKEN = "YOUR_MANAGEMENT_TOKEN";
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://<YOUR_TENANT>.auth0.com/api/v2/users")
.get()
.addHeader("authorization", "Bearer " + MANAGEMENT_TOKEN)
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
System.out.println("All done: " + response.body().string());
}
}