I am getting Unauthorized
errors when I try to create a user and then log in via NodeJS.
var auth = new auth0.AuthenticationClient({
clientId: process.env.AUTH0_CLIENT_ID,
domain: auth0Domain
});
const email = "..";
const password = "..";
const connection = ".."
const userCreateResult = await auth.database.signUp({email, password, connection})
// This fails
const authResult = await auth.oauth.passwordGrant({
username: email,
password,
realm: connection
});
The error message us: Unauthorized
A few notes:
- I’ve tried both the “Web App” and the “Machine-to-Machine App”… Both fail.
- The Token Endpoint Authentication Method is POST
- The Password Grant type is enabled
I noticed in the web view that the User record which results does not appear to have my application listed as authorized – could that be related? And how do I use the NodeJS management client to add that?