Auth0 Home Blog Docs

meet error Non-global clients are not allowed access to APIv1 when trying to get access token

access-token

#1

I’m trying to get access token with following code snippet, which is workable one year ago.
But it failed with error "Non-global clients are not allowed access to APIv1", what does “Non-global clients” mean and how to workaround it.

JSONObject jsonObject = new JSONObject();
jsonObject.put("client_id", "Qztgs5JefLiBKwu3jzfnRTG8uqyZUoel");
jsonObject.put("client_secret", "***************************");
jsonObject.put("grant_type", "client_credentials");
HttpPost post = new HttpPost("https://lcheng.auth0.com/oauth/token");	    							
post.setEntity(new StringEntity(jsonObject.toString(), ContentType.APPLICATION_JSON));
CloseableHttpResponse response = httpClient.execute(post); 
System.out.println(response.getStatusLine());
String result = EntityUtils.toString(response.getEntity(), ContentType.getOrDefault(response.getEntity()).getCharset());
System.out.println("reuslt=" + result);

#2

+1 got this too


#3

I got this error when I only sent client id and secret but didn’t send audience/domain


#4

Having the same issue. Did you solve it?


#5

Any update on this? I’m having the same issue


#6