What I want should be fairly simple, I guess. But I can’t find how to do it.
I want to authenticate a user agains the Auth0 database with javascript. I want to send the email/password and receive back the idToken of that user.
I don’t want to see a popup where the user has to enter his email/password. I don’t want a redirect after authenticating. Just sending the request from javascript and getting back the idToken.
What you describe is the “Resource Owner Password Grant” in OAuth2 parlance. It means that the application collects the credentials and sends them to the authorization server in exchange for a token.
Nowadays it’s considered an anti-pattern that’s reserved for legacy applications that can’t use browser-based authentication, because of security risks.
The application handles the credentials (username/password) instead of the actual authorization server.
By getting the user credentials, you can’t restrict what the application can access (you are giving the application full access to the user’s resources).