Auth0 Home Blog Docs

Programmatically Login through Lock



I’m using for UI testing and I wanted to programmatically login to avoid testing the Auth0 login. I’m trying to POSST to /usernamepassword/login and then /login/callback. I have a stackoverflow explaining it here: Am I doing this wrong? Is there a better way to do this?


If you want to programmatically login, use our javascript SDK


But doesn’t that still just use the lock which you would have to manually fill out the username and password? The client.login uses the Resource Owner Password Grant which my app is not using.


you want to bypass lock, right? so use webauth.login and you’ll get redirected to the callback page with the access_token etc.


Ahh, I completely missed the full docs link. I think this will work. Thank you so much.