Hi - when using auth0-java (GitHub - auth0/auth0-java: Java client library for the Auth0 platform) , I am getting this error:
com.auth0.exception.APIException:
Request failed with status code 403:
Grant type ‘password’ not allowed for
the client.
I have configured my client to use the default_directory of ‘Username-Password-Authentication’ and have created a user there. The code is below, with actual usernames/passwords substituted of course.
AuthAPI auth = new AuthAPI("mydomain.auth0.com", clientId, clientSecret);
AuthRequest request = auth.login("user@mydomain.com", "password")
.setAudience(myApiAudience)
.setScope("openid");
try {
TokenHolder holder = request.execute();
} catch (APIException exception) {
// api error
System.out.print(exception);
} catch (Auth0Exception exception) {
System.out.print(exception);
//request error
}