Auth0 Home Blog Docs

How do I lookup if a users email address exists in the Java API?

java

#1

From your starter example I have code that looks like this:

domain = config.getServletContext().getInitParameter(“com.auth0.domain”);
clientId = config.getServletContext().getInitParameter(“com.auth0.clientId”);
clientSecret = config.getServletContext().getInitParameter(“com.auth0.clientSecret”);

ManagementAPI managementAPI = new ManagementAPI(domain, clientId);

UsersEntity usersEntity = managementAPI.users();

Request auth0Request = usersEntity.get(email, null);

    auth0Request.execute();

When I execute this I get an error of:
Request failed with status code 400: Bad HTTP authentication header format

In the Docs around APIToken:
This string exists:
See the “Getting an API token” section to learn how to obtain a token.
Googling this in many forms does not get me to a guide on this topic. It be nice to have a URL for this at minimum.

Even more important it would be great to have some sample code so I know what the heck it is I should do and not have to live in the API designers head!!!

Thanks in advance for any help you can provide.

Jim


#2